-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (19 loc) · 909 Bytes
/
Dockerfile
File metadata and controls
26 lines (19 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
ARG BASE_IMAGE=alpine:3.15
FROM $BASE_IMAGE
# Use Ansible 4.8.0 by default
ARG ANSIBLE_VERSION=4.8.0
ENV ENV_ANSIBLE_VERSION=$ANSIBLE_VERSION
# Installs Dependencies
RUN apk add --update python3 py-pip openssl ca-certificates bash git sudo zip sshpass openssh-client rsync \
&& apk add --update --virtual build-dependencies python3-dev libffi-dev openssl-dev build-base
# Note: Apply fix from Jeff that allows pip install to work without --break-system-packages
# https://www.jeffgeerling.com/blog/2023/how-solve-error-externally-managed-environment-when-installing-pip3
RUN find /usr/lib/python* | grep EXTERNALLY-MANAGED | xargs -r rm
# Pip Dependencies
RUN pip install --upgrade pip cffi passlib \
&& pip install --upgrade pycrypto pywinrm
# Install Ansible
RUN pip install ansible==$ENV_ANSIBLE_VERSION
# Remove APK cache etc
RUN apk del build-dependencies \
&& rm -rf /var/cache/apk/*