Docker入门一安装

来源:互联网 发布:淘宝加盟公司靠谱吗 编辑:程序博客网 时间:2024/05/29 19:56

Install Docker on Ubuntu Linux

$ curl -fsSL https://get.docker.com/ | sh
安装成功后docker versionsudo service docker startsudo docker run hello-worldUnable to find image 'hello-world:latest' locallydocker: 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/dockerDOCKER_OPTS="--registry-mirror=http://yourRegist.m.daocloud.io"最后service docker restart
sudo docker run hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-world78445dd45222: Pull complete Digest: sha256:7820f4620e6cf3e795643fac2f6b09e7fd0a29e7e5c4eee6aac9ba0bedca158cStatus: Downloaded newer image for hello-world:latestHello from Docker!
~$ sudo docker ps -aCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMESf6935ce73938        hello-world         "/hello"            52 seconds ago      Exited (0) 50 seconds ago                    
4 0
原创粉丝点击