为什么需要设置代理
在运行docker run 时,首先会检查当前环境是否有对应的镜像,若没有将去docker hub
上下载。由于国内长城,基本上不可能直接访问到国外的docker hub
。
如下运行hello-world
报错:
[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:39795->[::1]:53: rea