From 80fe0cbf37051d0094cfe9ce7bda83cb886b532a 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: Tue, 18 May 2021 19:24:48 +0000
Subject: [PATCH] New

---
 .gitlab-ci.yml |  3 ---
 Dockerfile     | 43 +++++++++++++++++++++++++++++++++++++++----
 2 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5ff3713..71b9df5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,6 +22,3 @@ test:
     GIT_STRATEGY: "none"
   script:
     - drr "${CI_REGISTRY_IMAGE}:${CUSTOM_IMAGEPREFIX}-${CI_COMMIT_SHORT_SHA}" ansible --version
-    - drr "${CI_REGISTRY_IMAGE}:${CUSTOM_IMAGEPREFIX}-${CI_COMMIT_SHORT_SHA}" ansible -m ping localhost
-    - drr "${CI_REGISTRY_IMAGE}:${CUSTOM_IMAGEPREFIX}-${CI_COMMIT_SHORT_SHA}" ansible-lint --version
-    - drr "${CI_REGISTRY_IMAGE}:${CUSTOM_IMAGEPREFIX}-${CI_COMMIT_SHORT_SHA}" ansible-lint .
diff --git a/Dockerfile b/Dockerfile
index 8230fc3..a36fb93 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,40 @@
-FROM pipelinecomponents/ansible-lint:latest
+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 \
+        cargo \
+        && \
+    python3 -m venv /opt/ansible && \
+    pip3 install --ignore-installed --no-cache-dir --upgrade \
+        pip \
+        setuptools \
+        wheel \
+        && \
+    pip3 install --ignore-installed --no-cache-dir \
+        ansible \
+        ansible-lint \
+        mitogen \
+        jmespath \
+        pywinrm \
+        && \
+    apk del build-dependencies && \
+    rm -rf /var/cache/apk/*
 
-WORKDIR /opt/ansible
-
-RUN apk add --no-cache git git-lfs openssh-client rsync
+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
+COPY --from=builder /opt/ansible /opt/ansible
+CMD [ "ansible", "--version" ]
-- 
GitLab