Docker入门一安装

Install Docker on Ubuntu Linux

$ 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%3Alibrary%2Fhello-world%3Apull&service=registry.docker.io: read tcp 172.20.30.205:50310->50.17.62.194:443: read: connection reset by peer.

不能从国外下载镜像文件 参考下面链接配置国内镜像库

配置国内免费registry mirror

在 https://www.daocloud.io 注册账号 使用Docker 加速器

修改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                    

你可能感兴趣的:(Docker)