diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ff37136a6c9bccb0a0f18eab0f20633f90cdf8c..71b9df580298977abd52ded8f751a7b33285839a 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 8230fc38d5ef04084f772c68da4d042edbae6bdb..a36fb93c32bf73e390e20ae8a45efab1d994577a 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" ]