Skip to content

Commit 6e74a64

Browse files
committed
updated builder image, base image and Cybus ansible collection, housekeeping
1 parent 612b2e5 commit 6e74a64

File tree

2 files changed

+35
-8
lines changed

2 files changed

+35
-8
lines changed

Dockerfile

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG AWS
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
1111
RUN 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)
2828
RUN 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

4048
LABEL 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/
4362
COPY --from=builder /usr/bin/docker /usr/bin/docker
4463

4564
# add mqtt and json/yaml tools & upgrade ansible
4665
RUN pip3 install paho-mqtt boto3 ansible --upgrade
4766
RUN 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

5069
WORKDIR /data
5170
ENTRYPOINT ["/docker-entrypoint.sh"]

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ docker run --rm -v $(pwd):/data \
110110
CONNECTWARE_AGENT_COMPOSE_FILE_PATH: local-agent
111111
```
112112

113+
## Tool versions
114+
115+
List the versions of the contained tools with:
116+
117+
```bash
118+
docker run --rm -it jforge/ansible-aws-cybus:latest /bin/bash -c 'ansible --version | grep "python version" && python --version && python3 --version && pip3 --version && pip --version && pip list | grep boto && pip3 list | grep boto'
119+
```
120+
113121
## References
114122

115123
- [Cybus](https://cybus.io)

0 commit comments

Comments
 (0)