Skip to content

Commit c5f19af

Browse files
committed
fix(python): further tidies
1 parent f721788 commit c5f19af

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

python/3/Dockerfile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Python image for AMP containers including Python 3.10, 3.11 and 3.12
1+
# Python image for AMP containers including Python 3.10, 3.11 (default) and 3.12
22
# ghcr.io/cubecoders/amp:python-3
33

44
FROM python:3.10-slim-bookworm AS py310
@@ -15,25 +15,26 @@ ARG DEBIAN_FRONTEND=noninteractive
1515
RUN set -eux; \
1616
apt-get update; \
1717
apt-get install -y --no-install-recommends \
18-
python3.11 python3.11-venv python3-pip; \
18+
python3 python3-venv python3-pip; \
1919
apt-get clean; \
2020
rm -rf /var/lib/apt/lists/*
2121

22-
# Drop in Python 3.10
23-
COPY --from=py310 /usr/local/lib/ /usr/local/lib/
24-
COPY --from=py310 /usr/local/bin/ /usr/local/bin/
22+
# Drop in upstream Python 3.10
23+
COPY --from=py310 /usr/local/bin/python3.10 /usr/local/bin/
24+
COPY --from=py310 /usr/local/bin/pip3.10 /usr/local/bin/
25+
COPY --from=py310 /usr/local/lib/python3.10/ /usr/local/lib/python3.10/
26+
COPY --from=py310 /usr/local/lib/libpython3.10* /usr/local/lib/
2527

26-
# Drop in Python 3.12
27-
COPY --from=py312 /usr/local/lib/ /usr/local/lib/
28-
COPY --from=py312 /usr/local/bin/ /usr/local/bin/
28+
# Drop in upstream Python 3.12
29+
COPY --from=py312 /usr/local/bin/python3.12 /usr/local/bin/
30+
COPY --from=py312 /usr/local/bin/pip3.12 /usr/local/bin/
31+
COPY --from=py312 /usr/local/lib/python3.12/ /usr/local/lib/python3.12/
32+
COPY --from=py312 /usr/local/lib/libpython3.12* /usr/local/lib/
2933

3034
# Clean up
3135
RUN set -eux; \
3236
python3.10 -m pip --no-cache-dir install --upgrade pip setuptools wheel; \
3337
python3.12 -m pip --no-cache-dir install --upgrade pip setuptools wheel; \
3438
for shim in python3.10 python3.12 pip3.10 pip3.12; do \
3539
ln -sf "/usr/local/bin/$shim" "/usr/bin/$shim"; \
36-
done; \
37-
for shim in pip pip3 idle3 pydoc3 2to3 python-config python3-config; do \
38-
rm -f "/usr/local/bin/$shim"; \
3940
done

0 commit comments

Comments
 (0)