Fix Python build and install steps

This commit is contained in:
Andrew Ying 2024-11-17 20:07:36 +00:00
parent 5ee00700e7
commit ea74d092c9
Signed by: andrew
SSH key fingerprint: SHA256:6goOJXI6ckOipdsJS6oj5gbQYaRmCe37r7bSBnyQLyE

View file

@ -37,7 +37,7 @@ RUN set -x \
&& tar -xvzf Python-${PYTHON_VERSION}.tgz \
&& cd Python-${PYTHON_VERSION} \
&& ./configure \
--prefix=/usr/lib/python${PYTHON_VERSION_SHORT} \
--prefix=/usr \
--enable-optimizations \
&& make
@ -70,6 +70,7 @@ RUN apt-get update -y \
make \
openssl \
sudo \
tklib \
vim
RUN adduser --home /home/runner --shell /bin/bash --disabled-password runner \
@ -92,7 +93,7 @@ RUN set -x \
&& cd /tmp/build/Python-${PYTHON_VERSION} \
&& make install \
&& cd ../ \
&& rm -f Python-${PYTHON_VERSION} \
&& rm -r Python-${PYTHON_VERSION} \
&& ln -s /usr/lib/python${PYTHON_VERSION_SHORT}/bin/python${PYTHON_VERSION_SHORT} /usr/local/bin/python${PYTHON_VERSION_SHORT} \
&& ln -s /usr/local/bin/python${PYTHON_VERSION_SHORT} /usr/local/bin/python3 \
&& curl -O https://bootstrap.pypa.io/get-pip.py \