在写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 ...
随机推荐
- 【OpenAI】ChatGPT函数调用(Function Calling)实践
6月13日OpenAI在Chat Completions API中添加了新的函数调用(Function Calling)能力,帮助开发者通过API方式实现类似于ChatGPT插件的数据交互能力. 本文 ...
- 使用css 与 js 两种方式实现导航栏吸顶效果
场景描述 简单的说一下场景描述:这个页面有三个部分组成的. 顶部的头部信息--导航栏--内容 当页面滚动的时候.导航栏始终是固定在最顶部的. 我们使用的第一种方案就是使用css的粘性定位 positi ...
- vue3逻辑分离和页面快速展示数据
逻辑分层 我们在使用vue3开发项目的时候, 如何进行[区域分层]呢???? 举一个简单的小粒子 一个区域有[查询逻辑.修改后的保存逻辑.新增逻辑.删除逻辑] 这个页面可能还有其他的区域.A区域.B区 ...
- Typescript基本数据类型的讲解
1. typescript 的 7 种数据类型 typescript 的原始数据类型 string number boolean null underfined enum(枚举) symbol 这 7 ...
- 手写promise自定义封装异步任务回调的执行
自定义封装异步任务回调的执行 <script type="text/javascript"> let p = new Promise((resolve, reject) ...
- ABP-VNext 用户权限管理系统实战02---用户权限表的创建与迁移
一.表实体建立 1.菜单表 [Comment("菜单表")] [Table("t_identity_menu")] public class Menu : Au ...
- 消息队列RabbitMQ教程
RabbitMQ教程 翻译自RabbitMQ Tutorials. 0. 准备 前期准备 1. Hello World 最简入门教程 2. 工作队列 竞争消费者模式 3. 发布/订阅 同时发送消息给多 ...
- 为游戏接入ios sdk的oc学习笔记
开发手机游戏,需要接入ios的sdk,截止2021年7月23日虽然swift已经推出一些年头,但对于大部分的渠道sdk,还是oc的代码. oc不仅仅用来开发ios,还是mac上的app开发语言 从新手 ...
- go中string是如何实现的呢
go中string是如何实现的呢 前言 实现 go语言中的string是不可变的 []byte转string string转[]byte 字符串的拼接 +方式进行拼接 fmt 拼接 Join 拼接 b ...
- python处理Excel实现自动化办公教学(含实战)【二】
相关文章: python处理Excel实现自动化办公教学(含实战)[一] python处理Excel实现自动化办公教学(含实战)[二] python处理Excel实现自动化办公教学(数据筛选.公式操作 ...