From aa4cd5fa1b6508ce884188dcbe918cca3a0fa268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=A1=D0=B0?= =?UTF-8?q?=D1=84=D1=80=D0=BE=D0=BD=D0=BE=D0=B2?= <zimniy@cyberbrain.pw> Date: Thu, 1 Jul 2021 17:05:14 +0000 Subject: [PATCH] Fix --- Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4bbdc4b..fe3fe69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,21 @@ FROM registry.cyberbrain.pw/docker/alpine:latest AS builder -ARG ANSIBLE_VERSION +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 musl-dev python3-dev libffi-dev openssl-dev yaml-dev cargo && \ + apk --no-cache add --virtual build-dependencies ${ANSIBLE_BUILD_DEPENDENCIES} && \ python3 -m venv /opt/ansible && \ pip3 install --ignore-installed --no-cache-dir --upgrade pip setuptools wheel && \ - export ANSIBLE_PACKAGES="pyyaml ansible-lint mitogen jmespath pywinrm patch hvac" && \ - ( test -z $ANSIBLE_VERSION && pip install --ignore-installed --no-cache-dir ansible ${ANSIBLE_PACKAGES} || pip install --ignore-installed --no-cache-dir ansible\<=$ANSIBLE_VERSION ${ANSIBLE_PACKAGES} ) && \ + 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 yaml openssl ca-certificates sshpass openssh-client rsync git && \ +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" ] -- GitLab