From 655284edd2f56234fbfe1a96fceff24300f1afd0 Mon Sep 17 00:00:00 2001 From: Dmitriy Safronov Date: Tue, 18 May 2021 19:25:13 +0300 Subject: [PATCH] new --- Dockerfile | 56 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa48488..5a2681e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,43 @@ -FROM registry.cyberbrain.pw/docker/alpine:latest -RUN apk --no-cache add \ - sudo \ - python3 \ - py3-pip \ - openssl \ - ca-certificates \ - sshpass \ - openssh-client \ - rsync \ - git && \ +FROM registry.cyberbrain.pw/docker/alpine:latest AS builder +ENV PATH="/opt/ansible/bin:$PATH" +RUN apk --no-cache add python3 && \ apk --no-cache add --virtual build-dependencies \ + py3-pip \ + musl-dev \ python3-dev \ libffi-dev \ openssl-dev \ - rust \ - build-base && \ - pip3 install --no-cache-dir --upgrade \ + cargo \ + && \ + python3 -m venv /opt/ansible && \ + pip3 install --ignore-installed --no-cache-dir --upgrade \ pip \ - cffi \ - wheel && \ - pip3 install --no-cache-dir \ + setuptools \ + wheel \ + && \ + pip3 install --ignore-installed --no-cache-dir \ ansible \ - cryptography \ - mitogen ansible-lint jmespath \ - pywinrm && \ + ansible-lint \ + mitogen \ + jmespath \ + pywinrm \ + && \ apk del build-dependencies && \ - rm -rf /var/cache/apk/* && \ - mkdir -p /opt/ansible && \ + rm -rf /var/cache/apk/* + +FROM registry.cyberbrain.pw/docker/alpine:latest AS runtime +ENV PATH="/opt/ansible/bin:$PATH" +WORKDIR /srv/ansible +RUN apk --no-cache add \ + python3 \ + openssl \ + ca-certificates \ + sshpass \ + openssh-client \ + rsync \ + git \ + && \ mkdir -p /etc/ansible && \ echo 'localhost' > /etc/ansible/hosts -WORKDIR /opt/ansible +COPY --from=builder /opt/ansible /opt/ansible CMD [ "ansible", "--version" ] -- GitLab