搞定dockerhub上的镜像后,想拉新打的镜像,结果怎么都不行。后来用一年前自己包的hello,依然不行。记忆中应该是正常的。
[root@test /]# docker pull yllanzi/hello
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: dial tcp: lookup www.ik8s.ip on 183.60.83.19:53: no such host
开始认为是dns或者host的问题,直到用dig命令才回过味儿来,它没有A记录。
[root@test etc]# dig @8.8.8.8 www.ik8s.ip
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-9.P2.el7 <<>> @8.8.8.8 www.ik8s.ip
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 36759
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.ik8s.ip. IN A
;; AUTHORITY SECTION:
. 86395 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2020042500 1800 900 604800 86400
;; Query time: 29 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Apr 25 13:42:55 CST 2020
;; MSG SIZE rcvd: 115
并且k8s的网址不应出现在helloworld中,使用docker info查看信息
Client:
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 11
Server Version: 19.03.8
Storage Driver: overlay2
Backing Filesystem: <unknown>
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
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: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-1062.18.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.7GiB
Name: test
ID: 6DQG:FSBF:QKVR:COR7:IWZ4:MUJN:5GLO:CKDQ:NOIS:VBXY:323U:CPJR
Docker Root Dir: /var/lib/docker
Debug Mode: false
HTTPS Proxy: http://www.ik8s.ip:10070
No Proxy: 127.0.0.1/8
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
问题应该是出在HTTPS Proxy上了,看视频跟着学的。emmm… 忘记在哪里设的了,重翻一遍视频。
[root@test etc]# cat /usr/lib/systemd/system/docker.service |grep -P HTTPS
Environment="HTTPS_PROXY=http://www.ik8s.ip:10070"
修改完成后,刷新重启一条龙,再拉镜像,已经恢复正常。
[root@test etc]# systemctl daemon-reload
[root@test etc]# systemctl stop docker
[root@test etc]# systemctl start docker
[root@test etc]# docker pull yllanzi/hello
Using default tag: latest
latest: Pulling from yllanzi/hello
5e6ec7f28fb7: Pull complete
76e195ed530a: Pull complete
674dece4375b: Pull complete
c306b9f6d5e3: Pull complete
714ea95dd532: Pull complete
5e22d5dea8be: Pull complete
6262460ea54e: Pull complete
Digest: sha256:9d98bf50f9cb93748f494a0a914201918d2e1f0e337c6383c4b8c744189d8305
Status: Downloaded newer image for yllanzi/hello:latest
docker.io/yllanzi/hello:latest