正确配置registry后,为什么snap版docker镜像源不生效?

新手上路,请多包涵
  1. 配置文件
$ cat /var/snap/docker/current/config/daemon.json
{
    "log-level":        "error",
    "storage-driver":   "overlay2",
    "registry-mirrors": [
            "https://hub.atomgit.com",
            "https://docker.nju.edu.cn",
            "https://docker.m.daocloud.io",
            "https://dockerproxy.com",
            "https://noohub.ru",
            "https://huecker.io",
            "https://dockerhub.timeweb.cloud"
    ]
}
  1. docker info
$ docker info
Client:
 Version:    24.0.7
 Context:    default
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 8
 Server Version: 24.0.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version:
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-124-generic
 Operating System: Ubuntu Core 22
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 60.54GiB
 Name: machrevo
 ID: 85218287-d523-458a-be5f-f59a47aa0622
 Docker Root Dir: /var/snap/docker/common/var-lib-docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://hub.atomgit.com/
  https://docker.nju.edu.cn/
  https://docker.m.daocloud.io/
  https://dockerproxy.com/
  https://noohub.ru/
  https://huecker.io/
  https://dockerhub.timeweb.cloud/
 Live Restore Enabled: false
  1. docker search失败
$ docker search mysql
Error response from daemon: Get "https://index.docker.io/v1/search?q=mysql&n=25": dial tcp [2a03:2880:f107:83:face:b00c:0:25de]:443: i/o timeout
$ docker search mysql
Error response from daemon: Get "https://index.docker.io/v1/search?q=mysql&n=25": dial tcp 31.13.69.169:443: i/o timeout
  1. 疑问
    检查过dns和网络,均无问题。docker info显示已配置了正确镜像源,但docker的搜索对象却是https://index.docker.io/,导致超时错误。
$ nslookup
> hub.atomgit.com
Server:         192.168.1.1
Address:        192.168.1.1#53

Non-authoritative answer:
Name:   hub.atomgit.com
Address: 1.92.75.218
> docker.nju.edu.cn
Server:         192.168.1.1
Address:        192.168.1.1#53

Non-authoritative answer:
Name:   docker.nju.edu.cn
Address: 210.28.130.20
Name:   docker.nju.edu.cn
Address: 2001:da8:1007:4011::20
> docker.m.daocloud.io
Server:         192.168.1.1
Address:        192.168.1.1#53

Non-authoritative answer:
Name:   docker.m.daocloud.io
Address: 47.103.132.72
>
阅读 763
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏