-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.base
21 lines (20 loc) · 1.18 KB
/
Dockerfile.base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ARG ALPINE
FROM alpine:${ALPINE}
ARG ANSIBLE
ARG ANSIBLE_CORE
ENV PATH="/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
RUN apk --no-cache add python3 py3-cryptography py3-jinja2 py3-packaging py3-paramiko py3-resolvelib py3-passlib py3-yaml \
git openssh && \
apk --no-cache add --virtual builddeps alpine-sdk py3-pip && \
ln -s /bin/uname /usr/local/bin/uname && \
ln -s /bin/rm /usr/local/bin/rm && \
ln -s /bin/sh /usr/local/bin/sh && \
pip install --break-system-packages ansible-core==${ANSIBLE_CORE} ansible==${ANSIBLE} && \
pip cache purge && \
apk del builddeps && \
rm -rf /var/cache/apk/* && \
rm -rf /root/.cache/pip && \
find /usr/lib/python3.12/site-packages/ansible_collections -mindepth 1 -maxdepth 1 -type d ! -name 'community' ! -name 'ansible' -exec rm -rf {} + && \
find /usr/lib/python3.12/site-packages/ansible_collections/ansible -mindepth 1 -maxdepth 1 -type d ! -name 'utils' ! -name 'posix' -exec rm -rf {} + && \
find /usr/lib/python3.12/site-packages/ansible_collections/community -mindepth 1 -maxdepth 1 -type d ! -name 'general' ! -name 'docker' -exec rm -rf {} + && \
find /usr/lib/python3.12 -maxdepth 10 -name '*.pyc' -exec rm {} +;