Skip to content

Commit

Permalink
Make Dockerfile Python minor agnostic
Browse files Browse the repository at this point in the history
Extract Python minor version from `PYTHON_VERSION` environment variable
which is set by the python base image.
  • Loading branch information
simu committed Jan 17, 2025
1 parent 085d3eb commit 748b64e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ RUN ./tools/install-jb.sh v0.6.2 \

FROM base AS runtime

ENV PYTHON_MINOR="${PYTHON_VERSION%.*}"

RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
Expand All @@ -72,7 +74,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& echo " ControlMaster auto\n ControlPath /tmp/%r@%h:%p" >> /etc/ssh/ssh_config

COPY --from=builder \
/usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/
/usr/local/lib/python${PYTHON_MINOR}/site-packages/ \
/usr/local/lib/python${PYTHON_MINOR}/site-packages/
COPY --from=builder \
/usr/local/bin/kapitan* \
/usr/local/bin/commodore* \
Expand Down

0 comments on commit 748b64e

Please sign in to comment.