docker pull 慢的解决办法

释放双眼,带上耳机,听听看~!

镜像源

  1. 镜像源一:Docker 官方中国区

https://registry.docker-cn.com

  1. 镜像源二:网易

http://hub-mirror.c.163.com

  1. 镜像源三:ustc

https://docker.mirrors.ustc.edu.cn

修改方法

  1. 方式一

直接设置 –registry-mirror 参数,仅对当前的命令有效
docker run hello-world –registry-mirror=https://docker.mirrors.ustc.edu.cn

  1. 方式二

修改 /etc/default/docker,加入 DOCKER_OPTS=”镜像地址”,可以有多个
DOCKER_OPTS="–registry-mirror=https://docker.mirrors.ustc.edu.cn"

  1. 方式三

支持 systemctl 的系统,通过 sudo systemctl edit docker.service,会生成 etc/systemd/system/docker.service.d/override.conf 覆盖默认的参数
在该文件中加入如下内容:


1
2
3
4
1[Service]
2ExecStart=
3ExecStart=/usr/bin/docker -d -H fd:// --registry-mirror=https://docker.mirrors.ustc.edu.cn
4
  1. 方式四

新版的 Docker 推荐使用 json 配置文件的方式,默认为 /etc/docker/daemon.json,非默认路径需要修改 dockerd 的 –config-file,在该文件中加入如下内容:


1
2
3
4
1{
2"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
3}
4
  1. 重启

1
2
3
1systemctl daemon-reload
2sudo service docker start
3

给TA打赏
共{{data.count}}人
人已打赏
安全运维

MySQL和MongoDB数据相互迁移

2021-12-11 11:36:11

安全运维

Ubuntu上NFS的安装配置

2021-12-19 17:36:11

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索