在执行Dockerfile时出现Get https://registry-1.docker.io/v2/错误的解决方案

在执行Dockerfile时出现以下问题

[root@localhost test]# docker-compose up
Pulling redis (redis:alpine)...
ERROR: Get https://registry-1.docker.io/v2/: read tcp 192.168.137.151:39088->54.161.109.204:443: read: connection reset by peer

可以通过配置阿里云的镜像解决

{
 "registry-mirrors":["https://6kx4zyno.mirror.aliyuncs.com"]
}

创建daemon.json文件,并将上面的镜像复制粘贴进去

sudo vim /etc/docker/daemon.json

重启docker

systemctl daemon-reload 
systemctl restart docker

继续执行dockerfile文件的命令

[root@localhost test]# docker-compose up
Pulling redis (redis:alpine)...
alpine: Pulling from library/redis
5843afab3874: Already exists
9db2305878ef: Pull complete
3558750a1d54: Pull complete
240d71d1acc7: Pull complete
2a888d25337f: Pull complete
22e6fbce362a: Pull complete
Digest: sha256:0039796b887fd30e460353f14e46ba1004152aa97f5f59094cc21eac445fc89b
Status: Downloaded newer image for redis:alpine
Creating test_redis_1 ... done
Creating test_web_1   ... done

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

reg183

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值