dockerfile制作python3.9.6镜像


1、下载源码包

#wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tar.xz


2、Dockerfile:

FROM centos:centos7.9.2009

RUN yum -y install gcc make vim lsof wget tar bzip2 unzip vim-enhanced passwd sudo yum-utils hostname net-tools epel-release python-devel python-pip

ADD Python-3.9.6.tar.xz /opt/python396/

RUN cd /opt/python396/Python-3.9.6/ && mkdir -p /usr/local/python396 && ./configure prefix=/usr/local/python396 && \

make && make install && cd /usr/local/python396/bin/ && cp python3 /usr/bin/

3、 (构建镜像)
#docker build -t python3:3.9.6 -f Dockerfile .    (构建镜像)

4、(测试版本)

#docker run -it --name python01 python3:3.9.6  python3 --version  (测试版本)



 



本文标签: dockerfile python3.9.6 镜像

内容版权声明:【悟空故事】部分资源来源于网络,如有侵犯您的所有权,请随时告知我们,我们将立即删除!感谢配合!

转载请注明出处:https://blog.ff56.cn/xitong/1694065363.html