From 24a60f943e0afb52c7fb8a791609e73702e2a737 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Sat, 26 Jun 2021 13:43:56 +0300 Subject: [PATCH 1/2] Dockerfile --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 331d232..fd3e3c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM registry.cyberbrain.pw/docker/alpine:latest AS builder +ARG ANSIBLE_VERSION ENV PATH="/opt/ansible/bin:$PATH" RUN apk --no-cache add python3 && \ apk --no-cache add --virtual build-dependencies \ @@ -14,8 +15,11 @@ RUN apk --no-cache add python3 && \ setuptools \ wheel \ && \ + ( test -z $ANSIBLE_VERSION && \ + pip install --ignore-installed --user --no-cache-dir ansible || \ + pip install --ignore-installed --user --no-cache-dir ansible\<=$ANSIBLE_VERSION \ + ) && \ pip3 install --ignore-installed --no-cache-dir \ - ansible \ ansible-lint \ mitogen \ jmespath \ @@ -35,6 +39,8 @@ RUN apk --no-cache add \ sshpass \ openssh-client \ rsync \ - git + git \ + && \ + rm -rf /var/cache/apk/* COPY --from=builder /opt/ansible /opt/ansible CMD [ "ansible", "--version" ] -- GitLab From e501634eb7f7f0e523d4fc84bb6115c823beea3d Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Sat, 26 Jun 2021 14:00:46 +0300 Subject: [PATCH 2/2] Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fd3e3c0..e4d3c2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,8 @@ RUN apk --no-cache add python3 && \ wheel \ && \ ( test -z $ANSIBLE_VERSION && \ - pip install --ignore-installed --user --no-cache-dir ansible || \ - pip install --ignore-installed --user --no-cache-dir ansible\<=$ANSIBLE_VERSION \ + pip install --ignore-installed --no-cache-dir ansible || \ + pip install --ignore-installed --no-cache-dir ansible\<=$ANSIBLE_VERSION \ ) && \ pip3 install --ignore-installed --no-cache-dir \ ansible-lint \ -- GitLab