FROM centos:7 RUN rm /etc/yum.repos.d/* \ && curl -s -o ./Centos-7.repo https://mirrors.aliyun.com/repo/Centos-7.repo \ && curl -s -o ./epel.repo https://mirrors.aliyun.com/repo/epel-7.repo \ && sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' Centos-7.repo \ && yum install -y wget openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel python-devel \ libffi-devel tk-devel RUN wget -c https://www.python.org/ftp/python/3.9.16/Python-3.9.16.tar.xz \ && tar xf Python*.xz \ && cd Python-3.9.16 \ && ./configure prefix=/usr/local/python3 \ && make -j 2 && make altinstall && ln -s /usr/local/python3/bin/python3.9 /usr/bin/python3 # docker build -t lghost/python:3.9 . -f Dockerfile-alpine