Newer
Older
FROM base AS builder
ARG ANSIBLE_BUILD_DEPENDENCIES="build-base cargo libffi-dev musl-dev openssl-dev python3-dev yaml-dev"
ARG ANSIBLE_PACKAGES="ansible-lint hvac jinja2>=2.11 jmespath mitogen netaddr pyyaml pywinrm"
ENV PATH="/opt/ansible/bin:$PATH"
RUN apk --no-cache add python3 && \
apk --no-cache add --virtual build-dependencies ${ANSIBLE_BUILD_DEPENDENCIES} && \
pip3 install --ignore-installed --no-cache-dir --upgrade --disable-pip-version-check pip setuptools wheel && \
pip3 install --ignore-installed --no-cache-dir ansible ${ANSIBLE_PACKAGES} && \
FROM base AS runtime
ARG ANSIBLE_RUNTIME_DEPENDENCIES="ca-certificates git openssh-client openssl patch rsync sshpass yaml"
RUN apk --no-cache add python3 && \
apk --no-cache add ${ANSIBLE_RUNTIME_DEPENDENCIES} && \
COPY --from=builder /opt/ansible /opt/ansible
CMD [ "ansible", "--version" ]