Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

docker-compose up 镜像失败,报错网络错误

在云主机ecs、虚拟机上都执行过,都失败
docker-compose up -d nginx mysql

尝试解决:
1.配置了镜像加速也没用

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

2.ping raw.githubusercontent.com 也ping的通啊

3 /etc/hosts 加 199.232.68.133 raw.githubusercontent.com

image


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

raw.githubusercontent.com在国内基本被墙了,能ping通但是非常容易Conntect reset by peer,你反复重试还是有一定几率能联通的。如果你能改Dockerfile的话还是考虑用jsdelivr的镜像吧,支持github镜像,在国内有CDN节点,是可以成功的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...