Ubuntu安裝docker run hello-world無法連接倉庫?
过去多啦不再A梦
过去多啦不再A梦 2017-04-27 09:03:03
0
3
1020

在依照docker官網的安裝步驟安裝好後,運行hello-world結果出現:

:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: write tcp 10.11.66.20:49182->50.17.62.194:443: write: connection reset by peer.
See 'docker run --help'.

:~$ sudo docker login -u"gaoxi1993" -p"xxx"
Error response from daemon: Get https://registry-1.docker.io/v2/: Get https://auth.docker.io/token?account=gaoxi1993&client_id=docker&offline_token=true&service=registry.docker.io: read tcp 10.11.66.20:48290->50.17.62.194:443: read: connection reset by peer

我的docker版本資訊

:~$ sudo docker version 
Client:
 Version:      17.03.0-ce
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   3a232c8
 Built:        Tue Feb 28 08:01:32 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.0-ce
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   3a232c8
 Built:        Tue Feb 28 08:01:32 2017
 OS/Arch:      linux/amd64
 Experimental: false


:~$ sudo docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 17.03.0-ce
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 0
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-66-generic
Operating System: Ubuntu 16.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.12 GiB
Name: simer-ThinkPad-Edge-E330
ID: GJOM:LQNO:UZ7V:X2FM:O4ZI:FPFI:F6WN:NC2W:AIVP:PYKJ:F7PP:KZZW
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: gaoxi1993
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

檢查dns

:~$ nslookup auth.docker.io
Server:        127.0.1.1
Address:    127.0.1.1#53

Non-authoritative answer:
Name:    auth.docker.io
Address: 52.5.246.212
Name:    auth.docker.io
Address: 50.17.62.194
Name:    auth.docker.io
Address: 34.193.147.40

個人電腦資訊

:~$ uname -a
Linux ThinkPad-Edge 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

2017年03月12日19:52補充
換到家裡的網路重啟電腦後,第一次會出現

:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: read tcp 192.168.0.7:53058->50.17.62.194:443: read: connection reset by peer.
See 'docker run --help'.

:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete 
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Status: Downloaded newer image for hello-world:latest

Hello from Docker!

貌似是網路環境問題,真是見鬼了,目前已正常使用。

过去多啦不再A梦
过去多啦不再A梦

全部回覆(3)
过去多啦不再A梦

國內的網路原因你懂的。可以使用一些國內的docker鏡像,例如daocloud,時速雲,靈雀雲等,他們都提供了鏡像加速

为情所困

docker在使用的時候,很多命令需要調用/var/run/docker.sock
但是docker.sock需要較高的權限.
解決方法:
1.docker.sock權限授予用戶
2.切換到root( ubuntu 使用sudo su 切換)

黄舟

同樣的docker版本,已加入docker用戶群組,也是遇到這個問題。同樣的命令,一會兒報:

Error response from daemon: Get https://registry-1.docker.io/... read tcp 192.168.1.170:49652->50.17.62.194:443: read: conneer reset by peeeer

再過一會兒運作又是正常的,不知道網路哪裡出問題了

2017-03-26

改為使用中科大的源了,速度還比較快

https://lug.ustc.edu.cn/wiki/...

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板