55# --------------------------------------------------------------------------------------------------
66# Builder Image
77# --------------------------------------------------------------------------------------------------
8- FROM alpine:3.16 AS builder
8+ FROM alpine:3.20 AS builder
99
1010# Required tools for building Python packages
1111RUN set -eux \
@@ -20,32 +20,51 @@ RUN set -eux \
2020 openssl-dev \
2121 python3 \
2222 python3-dev \
23- py -pip \
23+ py3 -pip \
2424 docker \
2525 docker-cli-compose
2626
2727# Python packages (copied to final image)
2828RUN set -eux \
29- && pip3 install --no-cache-dir --no-compile \
30- docker \
31- jsondiff \
29+ && pip3 install --break-system-packages --no-cache-dir --no-compile \
30+ docker \
31+ jsondiff \
32+ && find /usr/lib/ -name '__pycache__' -print0 | xargs -0 -n1 rm -rf \
33+ && find /usr/lib/ -name '*.pyc' -print0 | xargs -0 -n1 rm -rf
34+
35+ # Clean-up some site-packages to safe space
36+ RUN set -eux \
37+ && pip3 uninstall --break-system-packages --yes \
38+ setuptools \
39+ wheel \
3240 && find /usr/lib/ -name '__pycache__' -print0 | xargs -0 -n1 rm -rf \
3341 && find /usr/lib/ -name '*.pyc' -print0 | xargs -0 -n1 rm -rf
3442
3543# --------------------------------------------------------------------------------------------------
3644# Final Image
3745# --------------------------------------------------------------------------------------------------
38- FROM cytopia/ansible:${ANSIBLE_VERSION:-latest}-${ANSIBLE_VERSION:-awshelm3.10 } AS production
46+ FROM cytopia/ansible:${ANSIBLE_VERSION:-latest}-${ANSIBLE_VERSION:-awshelm3.11 } AS production
3947
4048LABEL maintainer=
"jforge <[email protected] >" 49+ LABEL org.opencontainers.image.authors=
50+ LABEL org.opencontainers.image.created=
51+ LABEL org.opencontainers.image.description=
52+ LABEL org.opencontainers.image.documentation="https://github.com/jforge/docker-ansible-aws-cybus"
53+ LABEL org.opencontainers.image.name="ansible-aws-cybus"
54+ LABEL org.opencontainers.image.ref.name=
55+ LABEL org.opencontainers.image.revision=
56+ LABEL org.opencontainers.image.source="https://github.com/jforge/docker-ansible-aws-cybus"
57+ LABEL org.opencontainers.image.title="Ansible AWS Helm K8s Cybus collection"
58+ LABEL org.opencontainers.image.url="https://github.com/jforge/docker-ansible-aws-cybus"
59+ LABEL org.opencontainers.image.vendor="jforge"
4160
42- COPY --from=builder /usr/lib/python3.10 /site-packages/ /usr/lib/python3.10 /site-packages/
61+ COPY --from=builder /usr/lib/python3.12 /site-packages/ /usr/lib/python3.12 /site-packages/
4362COPY --from=builder /usr/bin/docker /usr/bin/docker
4463
4564# add mqtt and json/yaml tools & upgrade ansible
4665RUN pip3 install paho-mqtt boto3 ansible --upgrade
4766RUN apk add mosquitto mosquitto-clients jq yq
48- RUN ansible-galaxy collection install community.general amazon.aws cybus.connectware:${ANSIBLE_CONNECTWARE_COLLECTION_VERSION:-2.2.1 }
67+ RUN ansible-galaxy collection install community.general amazon.aws cybus.connectware:${ANSIBLE_CONNECTWARE_COLLECTION_VERSION:-2.2.3 }
4968
5069WORKDIR /data
5170ENTRYPOINT ["/docker-entrypoint.sh" ]
0 commit comments