dockerfile更改docker镜像源

方法一:

更换源

RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list \
&& apt-get update

方法二:

RUN echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" >/etc/apt/sources.list && \
    echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >>/etc/apt/sources.list && \
    echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >>/etc/apt/sources.list && \
    echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >>/etc/apt/sources.list

centos dockerfile 安装Python3.11

# 安装Python3.11依赖
RUN yum -y install gcc zlib zlib-devel libffi libffi-devel
RUN yum -y install bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel xz-devel gdbm-devel

# 安装Python3.11
RUN wget https://mirrors.huaweicloud.com/python/3.11.8/Python-3.11.8.tar.xz
RUN tar -xvf Python-3.11.8.tar.xz
RUN cd Python-3.11.8 && ./configure && make && make install && cd ..

ubuntu dockerfile 安装Python3.11

# 修改镜像源
RUN echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" >/etc/apt/sources.list && \
    echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >>/etc/apt/sources.list && \
    echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >>/etc/apt/sources.list && \
    echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >>/etc/apt/sources.list

# 安装Python3.11依赖
RUN apt-get update && apt install wget build-essential libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev

# 安装Python3.11
RUN wget https://mirrors.huaweicloud.com/python/3.11.8/Python-3.11.8.tar.xz
RUN tar -xvf Python-3.11.8.tar.xz
RUN cd Python-3.11.8 && ./configure && make && make install && cd ..

Python镜像源:

Index of python-local/3.11.8

相关推荐
PythonFun19 分钟前
自建RustDesk服务器:详细步骤与操作指南
运维·服务器
可涵不会debug23 分钟前
【Linux】信号知识三把斧——信号的产生、保存和处理
linux·运维·信号
facaixxx202425 分钟前
京东云主机怎么用?使用京东云服务器建网站(图文教程)
运维·服务器·京东云
jyan_敬言25 分钟前
【Linux】Linux命令与操作详解(一)文件管理(文件命令)、用户与用户组管理(创建、删除用户/组)
linux·运维·服务器·c语言·开发语言·汇编·c++
程序那点事儿1 小时前
k8s 之安装busybox
云原生·容器·kubernetes
-$_$-1 小时前
【黑马点评】 使用RabbitMQ实现消息队列——1.Docker与RabbitMQ环境安装
分布式·docker·rabbitmq
芯的一天1 小时前
windows下DockerDesktop命令行方式指定目录安装
windows·docker
学思之道2 小时前
给Linux操作系统命令取个别名
linux·运维·经验分享·学习方法
dong_beijing2 小时前
GO语言工程构建示例-mac和linux适用
linux·运维·服务器
先生沉默先2 小时前
Unity WebGL使用nginx作反向代理处理跨域,一些跨域的错误处理(添加了反向代理的配置依旧不能跨域)
运维·nginx·webgl