From fa01cd659568a538ec4ef97695767420c1b68213 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Thu, 1 Jul 2021 19:11:57 +0300 Subject: [PATCH 1/3] Dockerfile --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4bbdc4b..a1583a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,22 @@ FROM registry.cyberbrain.pw/docker/alpine:latest AS builder ARG ANSIBLE_VERSION +ARG ANSIBLE_BUILD_DEPENDENCIES="musl-dev python3-dev libffi-dev openssl-dev yaml-dev cargo" +ARG ANSIBLE_PACKAGES="pyyaml ansible-lint mitogen jmespath pywinrm patch hvac" 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} ) && \ #apk del build-dependencies && \ rm -rf /var/cache/apk/* FROM registry.cyberbrain.pw/docker/alpine:latest AS runtime +ARG ANSIBLE_RUNTIME_DEPENDENCIES="yaml openssl ca-certificates sshpass openssh-client rsync git" 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 From f1243f2110ae30fce9cd0a573e8358c921d1dcae Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Thu, 1 Jul 2021 19:13:30 +0300 Subject: [PATCH 2/3] Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a1583a6..0c4e28e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ 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 pip setuptools wheel && \ - ( 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} ) && \ + ( test -z $ANSIBLE_VERSION && pip3 install --ignore-installed --no-cache-dir ansible ${ANSIBLE_PACKAGES} || pip3 install --ignore-installed --no-cache-dir ansible\<=$ANSIBLE_VERSION ${ANSIBLE_PACKAGES} ) && \ #apk del build-dependencies && \ rm -rf /var/cache/apk/* -- GitLab From a8bbbca2194ae5429ec1f38475f8d51480d223c8 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Thu, 1 Jul 2021 20:00:23 +0300 Subject: [PATCH 3/3] Dockerfile --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0c4e28e..fe3fe69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,17 @@ FROM registry.cyberbrain.pw/docker/alpine:latest AS builder -ARG ANSIBLE_VERSION -ARG ANSIBLE_BUILD_DEPENDENCIES="musl-dev python3-dev libffi-dev openssl-dev yaml-dev cargo" -ARG ANSIBLE_PACKAGES="pyyaml ansible-lint mitogen jmespath pywinrm patch hvac" +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 pip setuptools wheel && \ - ( test -z $ANSIBLE_VERSION && pip3 install --ignore-installed --no-cache-dir ansible ${ANSIBLE_PACKAGES} || pip3 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="yaml openssl ca-certificates sshpass openssh-client rsync git" +ARG ANSIBLE_RUNTIME_DEPENDENCIES ENV PATH="/opt/ansible/bin:$PATH" WORKDIR /srv/ansible RUN apk --no-cache add python3 && \ -- GitLab