1. 程式人生 > >Docker入門一安裝

Docker入門一安裝

$ curl -fsSL https://get.docker.com/ | sh
安裝成功後
docker version

sudo service docker start

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: Get https://auth.docker.io/token?scope=repository%3
Alibrary%2Fhello-world%3Apull&service=registry.docker.io: read tcp 172.20.30.205:50310->50.17.62.194:443: read: connection reset by peer. 不能從國外下載映象檔案 參考下面連結配置國內映象庫
修改docker檔案
sudo vi /etc/default/docker

DOCKER_OPTS="--registry-mirror=http://yourRegist.m.daocloud.io"
最後
service docker restart
sudo docker run hello-world
Unable to
find image 'hello-world:latest' locally latest: Pulling from library/hello-world 78445dd45222: Pull complete Digest: sha256:7820f4620e6cf3e795643fac2f6b09e7fd0a29e7e5c4eee6aac9ba0bedca158c Status: Downloaded newer image for hello-world:latest Hello from Docker!
~$ sudo docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
f6935ce73938        hello-world         "/hello"
52 seconds ago Exited (0) 50 seconds ago