FROM registry.cyberbrain.pw/docker/alpine:latest AS builder ARG ANSIBLE_BUILD_DEPENDENCIES ARG ANSIBLE_PACKAGES ENV PATH="/opt/ansible/bin:$PATH" RUN apk --no-cache add python3 && \ apk --no-cache add --virtual build-dependencies ${ANSIBLE_BUILD_DEPENDENCIES} && \ python3 -m venv /opt/ansible && \ 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} && \ #apk del build-dependencies && \ rm -rf /var/cache/apk/* FROM registry.cyberbrain.pw/docker/alpine:latest AS runtime ARG ANSIBLE_RUNTIME_DEPENDENCIES ENV PATH="/opt/ansible/bin:$PATH" WORKDIR /srv/ansible RUN apk --no-cache add python3 && \ apk --no-cache add ${ANSIBLE_RUNTIME_DEPENDENCIES} && \ rm -rf /var/cache/apk/* COPY --from=builder /opt/ansible /opt/ansible CMD [ "ansible", "--version" ]