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