Last active
August 9, 2023 08:55
-
-
Save zclongpop123/f5764076cc7477e9ae96a3dbc9c5295e to your computer and use it in GitHub Desktop.
python docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM rockylinux:8 | |
ARG PYTHON_VERSION=3.10.12 | |
RUN sed -e 's|^mirrorlist=|#mirrorlist=|g' \ | |
-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.nju.edu.cn/rocky|g' \ | |
-i.bak \ | |
/etc/yum.repos.d/[Rr]ocky*.repo | |
RUN dnf makecache | |
RUN dnf -y update &&\ | |
dnf -y groupinstall "Development Tools" &&\ | |
dnf -y install wget gcc openssl-devel bzip2-devel libffi-devel xz-devel tk-devel &&\ | |
wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz &&\ | |
tar -xzf Python-$PYTHON_VERSION.tgz &&\ | |
cd Python-$PYTHON_VERSION &&\ | |
./configure --prefix=/usr/local/python/$PYTHON_VERSION/ &&\ | |
make &&\ | |
make altinstall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment