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

相关推荐
发光小北5 分钟前
关于六通道串口服务器详细讲解
运维·硬件工程
matrixlzp12 分钟前
K8S 启动探测、就绪探测、存活探测
云原生·容器·kubernetes
Dusk_橙子12 分钟前
在K8S中,如何使用EFK实现日志的统一管理?
云原生·容器·kubernetes
Tony115414 分钟前
Kubernetes v1.28.0安装dashboard v2.6.1(k8s图形化操作界面)
云原生·容器·kubernetes
龙胖不下锅15 分钟前
k8s资源预留
云原生·容器·kubernetes
ICT系统集成阿祥15 分钟前
科普篇 | “机架、塔式、刀片”三类服务器对比
运维·服务器
超级阿飞15 分钟前
利用Kubespray安装生产环境的k8s集群-排错篇
docker·容器·kubernetes
喝醉酒的小白17 分钟前
在 Kubernetes 上快速安装 KubeSphere v4.1.2
云原生·容器·kubernetes
liuzhenghua6638 分钟前
k8s优雅重启
云原生·容器·kubernetes
Dusk_橙子39 分钟前
在K8S中,Keepalived是如何检测工作节点是否存活的?
云原生·容器·kubernetes