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                    
  • 13
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值