在学习docker desktop的官方案例multi-container-app时,运行命令docker compose up -d时
遇到如下报错:
PS D:\AA\multi-container-app> docker compose up -d [+] Building 21.3s (3/3) FINISHED docker:desktop-linux => [todo-app internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 1.29kB 0.0s => ERROR [todo-app] resolve image config for docker-image://docker.io/docker/dockerfile:1 21.2s => [todo-app auth] docker/dockerfile:pull token for registry-1.docker.io 0.0s ------ > [todo-app] resolve image config for docker-image://docker.io/docker/dockerfile:1: ------ failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1: failed to authorize: failed to fetch oauth token: Post "https://auth.docker.io/token": dial tcp 108.160.161.20:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
解决方案:配置国内的docker镜像
在docker desktop中配置
镜像源参考:https://blog.csdn.net/llc580231/article/details/139979603
"registry-mirrors": [ "https://docker.registry.cyou", "https://docker-cf.registry.cyou", "https://dockercf.jsdelivr.fyi", "https://docker.jsdelivr.fyi", "https://dockertest.jsdelivr.fyi", "https://mirror.aliyuncs.com", "https://dockerproxy.com", "https://mirror.baidubce.com", "https://docker.m.daocloud.io", "https://docker.nju.edu.cn", "https://docker.mirrors.sjtug.sjtu.edu.cn", "https://docker.mirrors.ustc.edu.cn", "https://mirror.iscas.ac.cn", "https://docker.rainbond.cc" ]
然后点击“Apply&restart”按钮
备注:
在此处配置会有个小问题,重启后,镜像的配置项不会回显到配置栏内。
如果不确定是否配置成功,在命令行输入docker info命令查询
如下图所示,就是成功了。
标签:https,app,failed,报错,io,docker,image From: https://www.cnblogs.com/amnesia999/p/18433065