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

相关推荐
q***04631 小时前
Linux环境下Tomcat的安装与配置详细指南
linux·运维·tomcat
好奇的菜鸟1 小时前
在 WSL 中安装 Docker
运维·docker·容器
杨浦老苏1 小时前
AI驱动的图表生成器Next-AI-Draw.io
人工智能·docker·ai·群晖·draw.io
x***44011 小时前
linux 设置tomcat开机启动
linux·运维·tomcat
2301_804947582 小时前
nginx的https的搭建
运维·nginx·https
K***43062 小时前
httpslocalhostindex 配置的nginx,一刷新就报404了
运维·nginx
正在努力的小河2 小时前
Linux 块设备驱动实验
linux·运维·服务器
h***67372 小时前
Prometheus(普罗米修斯)----- Nginx监控
运维·nginx·prometheus
颜颜yan_2 小时前
基于CANN多Stream异步执行的智能推理管道:突破传统串行瓶颈
运维·架构·stream·昇腾·cann
陶庵看雪3 小时前
服务器纳管:核心概念与全流程解析
运维·服务器