当前位置: 首页 > news >正文

Dockerfile-CentOS7.9+Python3.11.2

本文为CentOS7.9下安装Python3.11.2环境的Dockerfile

# CentOS with Python3.11.2
# Author   xx@mail.com# build a new image with basic  centos
FROM centos:centos7.9.2009
# who is the author
MAINTAINER xx@mail.comRUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime# make a new directory to store the jdk files
RUN mkdir /opt/software \&& mkdir /usr/local/python3.11.2 \&& yum -y install vim net-tools telnet tree wget curl \&& yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel  gcc make libffi-devel -y \&& yum clean all# copy the jdk  archive to the image,and it will automaticlly unzip the tar file
ADD Python-3.11.2.tar.gz /opt/softwareWORKDIR /opt/software/Python-3.11.2
RUN ./configure --prefix=/usr/local/python3.11.2 --enable-shared CFLAGS=-fPIC \ && make \&& make installRUN mv /usr/bin/python /usr/bin/python2 \&& ln -s /usr/local/python3.11.2/bin/python3 /usr/bin/python \&& ln -s /usr/local/python3.11.2/bin/pip3 /usr/bin/pip3 \&& ln -s /usr/local/python3.11.2/bin/pip3 /usr/bin/pip \&& sed -i '1s/python/python2.7/g' /usr/bin/yum \&& sed -i '1s/python/python2.7/g' /usr/libexec/urlgrabber-ext-down \&& touch /etc/ld.so.conf.d/python.conf \&& echo '/usr/local/python3.11.2/lib' >> /etc/ld.so.conf.d/python.conf \&& ldconfig

执行

进入dockerfile所在目录
# docker build -t centos7_python3:3.11  .

查看镜像

http://www.lryc.cn/news/241449.html

相关文章:

  • 自定义责任链Filter实现
  • NX二次开发UF_CSYS_create_matrix 函数介绍
  • css引入的三种方式
  • 含羞草研究所研究含羞草的代码
  • 常见立体几何图形的体积
  • vue3 + vue-router + keep-alive缓存页面
  • unigui同页面内重定向跳转,企业微信内部应用开发获取用户code例子
  • 垃圾数据啊
  • GB/T 29498-2013 木门窗检测
  • rocketMQ5.0顺序消息golang接入
  • HuggingFace-利用BERT预训练模型实现中文情感分类(下游任务)
  • PSP - 从头搭建 抗原类别 (GPCR) 的 蛋白质结构预测 项目流程
  • 城市NOA加速落地,景联文科技高质量数据标注助力感知系统升级
  • 控制反转(IoC)是什么?
  • Redisson分布式锁源码解析、集群环境存在的问题
  • 2016年10月4日 Go生态洞察:HTTP追踪介绍
  • 分布式篇---第四篇
  • 从零开始的C++(十九)
  • opencv-使用 Haar 分类器进行面部检测
  • C++纯虚函数和抽象类 制作饮品案例(涉及知识点:继承,多态,实例化继承抽象类的子类,多文件实现项目)
  • 什么是网关和链路追踪,以及怎么使用?
  • git 文件被莫名其妙的或略且无论如何都查不到哪个.gitignore文件忽略的
  • nova组件简介
  • 【Vue】响应式与数据劫持
  • Modbus RTU转Profinet网关连接PLC与变频器通讯在机床上应用案例
  • Autoware 整体架构
  • 【maven】手动指定jar推送
  • 算法---定长子串中元音的最大数目
  • 美国汽车零部件巨头 AutoZone 遭遇网络攻击
  • WPF面试题入门篇