修改docker镜像源的方法

由于docker默认的源为国外官方源,下载速度较慢,所以在学习和使用中可改为国内的镜像源,这样速度会提高狠多。

方法一:

 编辑 /etc/docker/daemon.json

vi /etc/docker/daemon.json
#添加如下网易镜像源
{
"registry-mirrors": ["http://hub-mirror.c.163.com"]
}

方法二:

 编辑/etc/sysconfig/docker,在OPTIONS变量后追加参数  --registry-mirror=镜像源地址

vi /etc/sysconfig/docker
#编辑OPTIONS,添加中国科技大学的镜像源
OPTIONS='--selinux-enabled --log-driver=journald --registry mirror=https://docker.mirrors.ustc.edu.cn'

方法三:

 编辑/etc/default/docker,添加DOCKER_OPTS="--registry-mirror=镜像源"

vi /etc/default/docker
#指定镜像源为阿里的镜像源
DOCKER_OPTS="--registry-mirror=https://pee6w651.mirror.aliyuncs.com"

其他:docker pull拉取镜像时也可以指定仓库下载地址

Docker国内源说明:

Docker 官方中国区

https://registry.docker-cn.com

网易

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

中国科技大学

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

阿里云

https://pee6w651.mirror.aliyuncs.com

感谢:

 https://blog.csdn.net/yhjay88/article/details/73790487?utm_source=itdadao&utm_medium=referral

https://blog.csdn.net/jixuju/article/details/80158493

猜你喜欢

转载自blog.csdn.net/skh2015java/article/details/82631633
今日推荐