配置docker一些错误的解决方式

Pull遇到的问题

[root@chen-virtual-machine]# docker image pull library/hello-world 
Using default tag: latest 
Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: dial tcp 52.20.146.203:443: i/o timeout

通过dig @114.114.114.114 registry-1.docker.io找到可用IP

; <<>> DiG 9.16.1-Ubuntu <<>> @114.114.114.114 registry-1.docker.io
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35113
;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 4, ADDITIONAL: 8

;; QUESTION SECTION:
;registry-1.docker.io.		IN	A

;; ANSWER SECTION:
registry-1.docker.io.	27	IN	A	35.174.73.84
registry-1.docker.io.	27	IN	A	52.4.20.24
registry-1.docker.io.	27	IN	A	52.72.232.213
registry-1.docker.io.	27	IN	A	52.1.121.53
registry-1.docker.io.	27	IN	A	34.195.246.183
registry-1.docker.io.	27	IN	A	52.54.232.21
registry-1.docker.io.	27	IN	A	52.5.11.128
registry-1.docker.io.	27	IN	A	3.94.35.164

;; AUTHORITY SECTION:
docker.io.		35941	IN	NS	ns-421.awsdns-52.com.
docker.io.		35941	IN	NS	ns-1827.awsdns-36.co.uk.
docker.io.		35941	IN	NS	ns-1168.awsdns-18.org.
docker.io.		35941	IN	NS	ns-513.awsdns-00.net.

;; ADDITIONAL SECTION:
ns-1168.awsdns-18.org.	161851	IN	A	205.251.196.144
ns-1827.awsdns-36.co.uk. 24722	IN	A	205.251.199.35
ns-421.awsdns-52.com.	170891	IN	A	205.251.193.165
ns-513.awsdns-00.net.	151066	IN	A	205.251.194.1
ns-1168.awsdns-18.org.	161851	IN	AAAA	2600:9000:5304:9000::1
ns-1827.awsdns-36.co.uk. 24722	IN	AAAA	2600:9000:5307:2300::1
ns-421.awsdns-52.com.	165062	IN	AAAA	2600:9000:5301:a500::1
ns-513.awsdns-00.net.	151066	IN	AAAA	2600:9000:5302:100::1

;; Query time: 24 msec
;; SERVER: 114.114.114.114#53(114.114.114.114)
;; WHEN: 二 5月 26 17:12:06 CST 2020
;; MSG SIZE  rcvd: 482

尝试修改/etc/hosts强制docker.io相关的域名解析到其它可用IP

添加一个可用IP
52.4.20.24  registry-1.docker.io

验证

[root@chen-virtual-machine]# docker image pull library/hello-world
Using default tag: latest
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete 
Digest: sha256:6a65f928fb91fcfbc963f7aa6d57c8eeb426ad9a20c7ee045538ef34847f44f1
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest

[root@chen-virtual-machine]# docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/
For more examples and ideas, visit:
 https://docs.docker.com/get-started/

配置GCC编译
在这里插入图片描述
编写C文件
配置docker一些错误的解决方式_第1张图片

GCC完成对helloworld.c的编译
在这里插入图片描述

你可能感兴趣的:(环境配置,docker,linux,bug)