Docker之镜像地址

转载自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"] 
      }
posted @ 2020-03-26 15:27  小黄鱼的圈子  阅读(4236)  评论(0编辑  收藏  举报