docker,docker-compose 使用主机的dns

satuo20 1年前 ⋅ 553 阅读
  1. 修改主机配置/etc/docker/daemon.json,增加dns列表
{
  "registry-mirrors": ["https://registry-vpc.cn-shenzhen.aliyuncs.com","https://registry.cn-shenzhen.aliyuncs.com"],
  "insecure-registries":["http://reg.local.yjzhixue.com"],
  "dns" : [
    "114.114.114.114",
    "8.8.8.8",
    "192.168.0.93",
    "192.168.0.1"
  ]
}
  1. 重启docker
systemctl restart docker

全部评论: 0

    我有话说: