赞
踩
在执行docker build构建镜像,拉取镜像时报错 执行这个命名拉取镜像sudo docker run hello-world,报以下错误
实质都是拉取镜像源超时报错,那么就是镜像源的问题
vim /etc/docker/daemon.json
输入以下内容
- {
- "registry-mirrors":[
- "https://i1el1i0w.mirror.aliyuncs.com",
- "https://hub-mirror.c.163.com",
- "https://registry.aliyuncs.com",
- "https://registry.docker-cn.com",
- "https://docker.mirrors.ustc.edu.cn"
- ]
- }
或者直接使用tee命令添加(二选一即可)
- sudo tee /etc/docker/daemon.json <<-'EOF'
- {
- "registry-mirrors":[
- "https://i1el1i0w.mirror.aliyuncs.com",
- "https://hub-mirror.c.163.com",
- "https://registry.aliyuncs.com",
- "https://registry.docker-cn.com",
- "https://docker.mirrors.ustc.edu.cn"
- ]
- }
- EOF
重启守护进程
sudo systemctl daemon-reload
重启服务
sudo systemctl restart docker
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。