在 macOS 11.3.1 和最新的 Docker 社区版本之后无法拉取和构建 docker 镜像

时间:2021-05-21 13:02:45

标签: macos docker build macos-big-sur

所以我正在尝试构建我的本地 golang 镜像和/或拉取镜像,但我收到了一个我以前从未见过的错误(在 macOS Big Sur 11.3.1 上)。另外,我不知道这是否与最近对 macOS 的更新搞砸了或其他事情有关。我从我的家庭局域网执行此操作,我以前从未遇到过此问题。对不起,横向滚动文本。

这种行为对所有类型的 docker pull/build 都会重复,到目前为止我尝试过的事情是:

  • 重启docker引擎
  • 重启mac
  • 尝试为 http/https 手动设置代理设置(HTTP 代理:http.docker.internal:3128 HTTPS 代理:https.docker.internal:3128) 与堆栈中的其他线程相同。
❯ docker build -t oscaralmgren/banking-api .
[+] Building 8.9s (3/3) FINISHED                                                                                                                          
 => [internal] load build definition from Dockerfile                                                                                                 0.6s
 => => transferring dockerfile: 214B                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                    0.4s
 => => transferring context: 2B                                                                                                                      0.0s
 => ERROR [internal] load metadata for docker.io/library/golang:latest                                                                               8.1s
------
 > [internal] load metadata for docker.io/library/golang:latest:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head https://registry-1.docker.io/v2/library/golang/manifests/latest: proxyconnect tcp: dial tcp 192.168.65.1:3128: connect: network is unreachable 

❯ docker pull mongo
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: dial tcp 192.168.65.1:3128: connect: network is unreachable

❯ docker version
Client:
 Cloud integration: 1.0.14
 Version:           20.10.6
 API version:       1.41
 Go version:        go1.16.3
 Git commit:        370c289
 Built:             Fri Apr  9 22:46:57 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.6
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8728dd2
  Built:            Fri Apr  9 22:44:56 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.4
  GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc:
  Version:          1.0.0-rc93
  GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

1 个答案:

答案 0 :(得分:0)

所以最后我通过打开故障排除菜单,清除所有数据,卸载然后重新安装来解决问题。

这不是首选的解决方案,因为我的一些容器丢失了一些工作进度。