Skip to content

Instantly share code, notes, and snippets.

@zclongpop123
Last active August 9, 2023 08:55
Show Gist options
  • Save zclongpop123/f5764076cc7477e9ae96a3dbc9c5295e to your computer and use it in GitHub Desktop.
Save zclongpop123/f5764076cc7477e9ae96a3dbc9c5295e to your computer and use it in GitHub Desktop.
python docker
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