Files
ansible/dockerfile/Dockerfile
2025-07-26 16:37:12 +08:00

22 lines
562 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 使用 Alpine Linux 最新版
FROM alpine:3.22.1
# 安装基础依赖Alpine 使用 apk
RUN apk add --no-cache python3 py3-pip openssh-client less
# 创建虚拟环境
RUN python3 -m venv /opt/venv
# 激活虚拟环境
ENV PATH="/opt/venv/bin:$PATH"
# 安装 Ansible 和其他 Python 包
RUN pip3 install --no-cache-dir ansible-core==2.19.0 pywinrm && ansible-galaxy collection install ansible.windows
# 创建工作目录
RUN mkdir -p /data/ansible
WORKDIR /data/ansible
# 默认启动命令(保持容器运行)
CMD ["tail", "-f", "/dev/null"]