轉載自https://www.cnblogs.com/doraman/p/9570891.html
官方docker hub
官方:https://hub.docker.com/explore/
常用docker 國內鏡像源:
網易鏡像中心:http://hub-mirror.c.163.com
阿里鏡像中心:https://dev.aliyun.com
Docker 官方中國區:https://registry.docker-cn.com
ustc: https://docker.mirrors.ustc.edu.cn
daocloud:https://hub.daocloud.io/
docker國內免費加速器:
daocloud:https://***(自己注冊的私有賬號).m.daocloud.io
aliyun:https://***(自己注冊的私有賬號).mirror.aliyuncs.com
修改方法
- 直接設置 –registry-mirror 參數,僅對當前的命令有效
docker run hello-world --registry-mirror=https://docker.mirrors.ustc.edu.cn
- 修改 /etc/default/docker,加入 DOCKER_OPTS=”鏡像地址”,可以有多個
DOCKER_OPTS="--registry-mirror=https://docker.mirrors.ustc.edu.cn"
- 支持 systemctl 的系統,通過 sudo systemctl edit docker.service,會生成 /etc/systemd/system/docker.service.d/override.conf 覆蓋默認的參數,在該文件中加入如下內容:
[Service]
ExecStart=
ExecStart=/usr/bin/docker -d -H fd:// --registry-mirror=https://docker.mirrors.ustc.edu.cn - 新版的 Docker 推薦使用 json 配置文件的方式,默認為 /etc/docker/daemon.json,非默認路徑需要修改 dockerd 的 –config-file,在該文件中加入如下內容:
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}