在写dockerfile时替换国内源
众所周知,Debian是linux发行版中官方源最难用的一个,这个傻逼源让我再构建docker镜像时卡了很久。
那么能不能替换构建dockerfile时使用的源呢?显然是可以的
在与Dockerfile同级的目录中准备一个sources.list(系统版本要对应,这里是Debian11),把里面的源换成比较快的国内源,另外版本代号也要跟镜像对应起来
Debian11(bullseye)的国内源(https://blog.csdn.net/weixin_48646819/article/details/120139802):
#http://mirrors.163.com/debian/为软件源也可以为其他的 bullseye为版本代号 main non-free contrib区别如下
deb http://mirrors.163.com/debian/ bullseye main non-free contrib
deb http://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb http://mirrors.163.com/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ bullseye main non-free contrib
deb-src http://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ bullseye-backports main non-free contrib
#deb http://mirrors.163.com/debian-security/ bullseye/updates main non-free contrib
#deb http://mirrors.ustc.edu.cn/debian-security/ bullseye/updates main non-free contrib
#deb-src http://mirrors.163.com/debian-security/ bullseye/updates main non-free contrib
#deb-src http://mirrors.ustc.edu.cn/debian-security/ bullseye/updates main non-free contrib
deb http://mirrors.ustc.edu.cn/debian-security/ stable-security main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian-security/ stable-security main non-free contrib
在Dockerfile中,使用类似如下代码,在apt update之前替换掉软件源即可:
FROM debian:bullseye
# Add custom china source,ADD可将本地文件添加到镜像中,类似于具有root权限的cp命令
ADD sources.list /etc/apt/
在写dockerfile时替换国内源的更多相关文章
- pip 源 替换国内源
网上收集来的pip源地址: 阿里云 http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simp ...
- pip安装时使用国内源加快下载速度
国内源: 清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 h ...
- pip安装时使用国内源,加快下载速度
国内源: 新版ubuntu要求使用https源,要注意. 清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirrors.aliyun.c ...
- ubuntu 替换国内源,清华源
参考 https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ Ubuntu 的软件源配置文件是 /etc/apt/sources.list.将系统自带的该文 ...
- PVE联网及更换国内源
一.PVE联网 第一次安装PVE,正常情况下PVE的IP是在我们上网的网段的.没有网络有可能是没有配置DNS服务器地址或DNS地址是软路由网关地址.解决方法有3种: 1:设置DHCP自动获取网络地址和 ...
- dockerfile debian 和pip使用国内源
python官方镜像是基于debian的.国内使用时定制一下,加快下载速度. 1 debian本身使用国内源 dockfile中: #国内debian源 ADD sources.list /etc/a ...
- 将raspberry 3B+的apt替换为国内源
前段时间买了一块树莓派,想着自己拿来玩一下下(没什么钱烧更好的硬件,只能玩这个了,好在还够玩).于是就折腾起来,装了raspberry的系统. 这时候,因为默认apt是国外的源,在GFW这种神奇东西的 ...
- ubuntu18.04 apt-get换国内源 阿里源 163源 清华源 中科大源
服务器上安装了最新的Ubuntu Server 18.04,代号为bionic.使用apt-get命令安装软件时,有时候速度比较慢,有时候会失败.因此考虑用国内的镜像源更换下apt-get的默认源. ...
- [转帖]centos7 使用kubeadm 快速部署 kubernetes 国内源
centos7 使用kubeadm 快速部署 kubernetes 国内源 https://www.cnblogs.com/qingfeng2010/p/10540832.html 前言 搭建kube ...
- 在Kali linux下使用docker配置sqli-labs(国内源的配置和系统软件更新)
本篇blog导航: ~前言 ~第一步:在安装好的kali配置国内源 ~第二步:安装docker ~第三步:docker下安装sqli-labs ~写在最后. 前言: 最近闲来无事,在闯关sqli-la ...
随机推荐
- [转帖]Cgroups资源限制
https://cloud.tencent.com/developer/article/2108816?areaSource=105001.13&traceId=QzVtWN5jGl8zeYZ ...
- centos8上安装中文字符集
https://www.cnblogs.com/kaishirenshi/p/12669353.html yum install glibc-common yum install -y langpac ...
- MeshFilter mesh vs sharedMesh
MeshFilter有两个属性mesh和sharedMesh,从官方文档和实际使用来说说这两者的区别 MeshFilter文档 Unity的MeshFilter文档:https://docs.unit ...
- vim 从嫌弃到依赖(23)——最后的闲扯
截止到上一篇文章,关于vim的基础操作都已经讨论完了,这篇我主要就是闲扯,瞎聊.就想毕业论文都有一个致谢一样,这篇我们就作为整个系列的致谢吧 学习vim到底能给我们带来什么 学习vim到底能给我们带来 ...
- 微信小程序-页面跳转navigator组件
官方文档地址:https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/route.html 在官方文档当中有提到一 ...
- 【SpringBoot】AOP默认的动态代理
分析: 当引入AOP相关依赖后 <dependency> <groupId>org.springframework</groupId> <artifactId ...
- 2.基于Label studio的训练数据标注指南:(智能文档)文档抽取任务、PDF、表格、图片抽取标注等
文档抽取任务Label Studio使用指南 1.基于Label studio的训练数据标注指南:信息抽取(实体关系抽取).文本分类等 2.基于Label studio的训练数据标注指南:(智能文档) ...
- C/C++ 病毒破坏手法总结
针对注册表恶意修改: #include <stdio.h> #include <Windows.h> // 禁用系统任务管理器 void RegTaskmanagerForbi ...
- 【Java】Java版本升级,找不到符号 问题处理
哈喽,各位早上/中午/晚上好呀! JDK21出了也有一段时间了,有的小伙伴也按捺不住开始将项目升级到JDK21了吧. 既然升级,大概多多少少都会遇到"找不到符号"的问题,英文原文是 ...
- CF1045G AI robots题解
题目链接:洛谷 或者 CF 本题考虑转化为 cdq 分治模型 对于 cdq 分治来说,只需要考虑左边对右边的影响,那我们要考虑该怎样设置第一维度的左右对象.很显而易见的是抛开 \(q\) 限制而言,我 ...