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

相关推荐
广州工博科技8 小时前
SAP Joule for Consultants 如何为自动化与集成项目提供支持?
运维·自动化
铁弹神侯8 小时前
Docker 入门
docker
Acrellea8 小时前
数据中心这台新变压器,让配电房的电表全失效了
运维·能源
boy快快长大8 小时前
【Jenkins】入门学习
运维·学习·jenkins
叼烟扛炮8 小时前
Linux 学习笔记(九):自动化构建神器 Make 与 Makefile
linux·运维·服务器
lisanmengmeng8 小时前
监控Kubernetes集群的GPU资源(三)
linux·容器·kubernetes
北塔软件8 小时前
从根因分析到协同执行,如何让AI运维真正落地?
运维·人工智能
码农1001号9 小时前
emqx5.8开源版WSS连接
运维·服务器
海宇AI9 小时前
零信任架构实战:基于海宇车辆车五项信息核验构建自动化汽配供应链车型分类与发动机型号适配网关
运维·人工智能·架构·自动化
程序员-Benothing9 小时前
Linux端口与连接排查:ss、lsof、nc、telnet、curl
linux·运维·服务器