当前位置: 首页 > news >正文

dockerfile文档编写(2):docker pull、apt install和pip镜像加速

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
运行给的终端命令

在这里插入图片描述

全覆盖法

{"registry-mirrors": ["https://registry.docker-cn.com","http://hub-mirror.c.163.com","https://dockerhub.azk8s.cn","https://mirror.ccs.tencentyun.com","https://registry.cn-hangzhou.aliyuncs.com","https://docker.mirrors.ustc.edu.cn","https://docker.m.daocloud.io",   "https://noohub.ru", "https://huecker.io","https://dockerhub.timeweb.cloud" ]
}

试了很多办法,还是下载的很慢,突然意识到下载的时候是pip下载,pip也是需要指定镜像源的,dockfile制定了镜像源之后,pull的时候确实很快,但是管不了pip。

file文件中

指定了pip的镜像源,在run指令pip 下载requirements.txt的时候起飞了

RUN pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/simple

指定apt install的镜像源,apt install 起飞

RUN echo "\
deb https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free \n\
deb https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free \n\
deb https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free \n\
deb https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free" > /etc/apt/sources.list

http://www.mrgr.cn/news/81067.html

相关文章:

  • EdgeX Core Service 核心服务之 Core Command 命令
  • xiaomiR4c openwrt
  • 2.6 网络面试问题
  • 音视频入门基础:AAC专题(13)——FFmpeg源码中,获取ADTS格式的AAC裸流音频信息的实现
  • strongswan测试证书生成
  • css
  • CDN信息收集(小迪网络安全笔记~
  • FLV视频封装格式详解
  • dockerfile文档编写(3):构建失败后清理缓存(删除容器和镜像相关命令)
  • Day13 用Excel表体验梯度下降法
  • 某狐畅游24校招-C++开发岗笔试(单选题)
  • 一起学Git【番外篇:如何在Git中新建文件】
  • 【全栈开发】----用pymysql库连接MySQL,批量存入
  • Vue3:uv-upload图片上传
  • 数智化医院分布式计算框架融合人工智能方向初步实现与能力转换浅析
  • SpringBoot使用 AOP 实现自定义日志记录并保存在Mysql
  • UITableView实现通讯录效果
  • javaEE-多线程编程-3
  • 某政银行APP登陆逆向
  • go聊天系统项目6-服务端发送消息