Skip to content

Commit 17fe1c3

Browse files
committed
fix build
1 parent a041f2d commit 17fe1c3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.generator/Dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ RUN apt-get update && \
3838
# Set up environment variables for tool versions to make updates easier.
3939
ENV BAZELISK_VERSION=v1.26.0
4040

41+
# Get the pip installation script using the instructions below
42+
# https://pip.pypa.io/en/stable/installation/#get-pip-py
43+
# Attempts to use `ensurepip` instead of `get-pip.py` resulted in errors like `python3.13.5 not found`
44+
RUN wget --no-check-certificate -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py'
45+
46+
4147
RUN for PYTHON_VERSION in 3.9.23 3.10.18 3.11.13 3.12.11 3.13.5; do \
4248
# Install Python from source
4349
wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
@@ -47,15 +53,12 @@ RUN for PYTHON_VERSION in 3.9.23 3.10.18 3.11.13 3.12.11 3.13.5; do \
4753
make altinstall && \
4854
cd / && \
4955
rm -rf Python-${PYTHON_VERSION}* && \
50-
# Install pip using the instructions below
51-
# https://pip.pypa.io/en/stable/installation/#ensurepip
52-
PYTHON_VERSION_TRIMMED=$(echo ${PYTHON_VERSION} | cut -d . -f -2) && \
53-
# Create an alias for python${PYTHON_VERSION} so that it points to python${PYTHON_VERSION_TRIMMED}
54-
# to resolve error `python3.13.5: command not found` while `python3.13` works
55-
alias python${PYTHON_VERSION}=python${PYTHON_VERSION_TRIMMED} && \
56-
python${PYTHON_VERSION} -m ensurepip --upgrade \
56+
python${PYTHON_VERSION} /tmp/get-pip.py \
5757
; done
5858

59+
# Remove the pip installation script
60+
RUN rm /tmp/get-pip.py
61+
5962
# Test Pip
6063
RUN python3.9 -m pip
6164
RUN python3.10 -m pip

0 commit comments

Comments
 (0)