MacOS上配置docker国内镜像仓库地址

背景

docker官方镜像仓库网速较差,我们需要设置国内镜像服务
我的MacOS docker版本如下
在这里插入图片描述

设置docker国内镜像仓库地址

在这里插入图片描述

  1. 点击Settings
  2. 点击Docker Engine
  3. 修改配置文件,添加registry-mirrors
{
    
    
  "builder": {
    
    
    "gc": {
    
    
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "data-root": "/var/lib/docker",
  "experimental": false,
  "features": {
    
    
    "buildkit": true
  },
  "registry-mirrors": [
    "https://docker.mirrors.ustc.edu.cn/",
    "https://hub-mirror.c.163.com/",
    "https://registry.docker-cn.com/"
  ]
}

其他参考

参考阿里云的镜像加速文档:https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
上述链接需要登录阿里云账号获取专属用户的镜像加速器地址
在这里插入图片描述
可将该地址也配置到registry-mirrors

猜你喜欢

转载自blog.csdn.net/u011308433/article/details/132058397