Docker无法拉取hello-world镜像

在ubuntu安装好docker使用hello-world测试,但报错

sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
719385e32844: Retrying in 1 second 
docker: error pulling image configuration: download failed after attempts=6: dial tcp 104.18.122.25:443: i/o timeout.
See 'docker run --help'.

我的解决方法是多配置几个加速镜像地址

先访问容器镜像服务 (aliyun.com)获取自己阿里云加速器地址,再去网上找一些加速地址

sudo mkdir -p /etc/docker
sudo nano /etc/docker/daemon.json

{"registry-mirrors": [
    "https://xxxxxxx.mirror.aliyuncs.com", #改成自己的阿里云加速器地址
    "https://docker.rainbond.cc",
    "https://do.nark.eu.org",
    "https://dc.j8.work",
    "https://docker.m.daocloud.io",
    "https://dockerproxy.com",
    "https://registry.docker-cn.com",
    "https://docker.mirrors.ustc.edu.cn",
    "https://hub-mirror.c.163.com",
    "https://mirror.baidubce.com",
    "https://docker.nju.edu.cn"
  ]
}
sudo systemctl daemon-reload
sudo systemctl restart docker

这时候再拉去镜像就不会报错了

sudo docker run hello-world

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值