“利用Dockerfile修改容器中的apt源(debian源)”的版本间的差异
跳到导航
跳到搜索
(→1) |
(→2) |
||
第23行: | 第23行: | ||
<pre> | <pre> | ||
+ | wget -c http://mirrors.163.com/.help/sources.list.stretch | ||
+ | cp sources.list.stretch sources.list #在Dockerfile 同一个目录 | ||
+ | |||
+ | |||
+ | |||
# Add custom china source | # Add custom china source | ||
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak | RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak |
2020年2月24日 (一) 07:03的版本
由于众所周知的原因 默认的debian是用了官网的源,在天朝就非卡 所以 有时就得改一下源喽
1
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list RUN apt clean RUN apt update
2
#apt-get源 使用aliyun的源 RUN mv /etc/apt/sources.list /etc/apt/sources.list.bakevan && \ echo "deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib" >/etc/apt/sources.list && \ echo "deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib" >/etc/apt/sources.list && \ echo "deb http://mirrors.aliyun.com/debian-security stretch/updates main" >/etc/apt/sources.list && \ echo "deb-src http://mirrors.aliyun.com/debian-security stretch/updates main" >/etc/apt/sources.list && \ echo "deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib" >/etc/apt/sources.list && \ echo "deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib" >/etc/apt/sources.list && \ echo "deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib" >/etc/apt/sources.list && \ echo "deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib" >/etc/apt/sources.list
2
wget -c http://mirrors.163.com/.help/sources.list.stretch cp sources.list.stretch sources.list #在Dockerfile 同一个目录 # Add custom china source RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak ADD sources.list /etc/apt/ && apt-get update -y && apt-get install -y libgdiplus && apt-get clean && ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll