Skip to content
Snippets Groups Projects

Resolve "Customizable Ansible version"

Merged Dmitriy Safronov requested to merge 3-customizable-ansible-version into master
1 file
+ 8
2
Compare changes
  • Side-by-side
  • Inline
+ 8
2
FROM registry.cyberbrain.pw/docker/alpine:latest AS builder
FROM registry.cyberbrain.pw/docker/alpine:latest AS builder
 
ARG ANSIBLE_VERSION
ENV PATH="/opt/ansible/bin:$PATH"
ENV PATH="/opt/ansible/bin:$PATH"
RUN apk --no-cache add python3 && \
RUN apk --no-cache add python3 && \
apk --no-cache add --virtual build-dependencies \
apk --no-cache add --virtual build-dependencies \
@@ -14,8 +15,11 @@ RUN apk --no-cache add python3 && \
@@ -14,8 +15,11 @@ RUN apk --no-cache add python3 && \
setuptools \
setuptools \
wheel \
wheel \
&& \
&& \
 
( test -z $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 \
pip3 install --ignore-installed --no-cache-dir \
ansible \
ansible-lint \
ansible-lint \
mitogen \
mitogen \
jmespath \
jmespath \
@@ -35,6 +39,8 @@ RUN apk --no-cache add \
@@ -35,6 +39,8 @@ RUN apk --no-cache add \
sshpass \
sshpass \
openssh-client \
openssh-client \
rsync \
rsync \
git
git \
 
&& \
 
rm -rf /var/cache/apk/*
COPY --from=builder /opt/ansible /opt/ansible
COPY --from=builder /opt/ansible /opt/ansible
CMD [ "ansible", "--version" ]
CMD [ "ansible", "--version" ]
Loading