为什么 docker 在 mac 上构建显然试图使用代理?

问题描述 投票:0回答:1

我有以下

Dockerfile

FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y cmake 

我已经通过

brew install --cask docker
在 Mac 上安装了 Docker Desktop。当我运行
docker build .
时,它失败并显示:

 > [2/2] RUN apt-get update && apt-get install -y cmake:
0.100 Err:1 http://deb.debian.org/debian bullseye InRelease
0.100   Could not connect to localhost:8080 (127.0.0.1). - connect (111: Connection refused)
0.100 Err:2 http://deb.debian.org/debian-security bullseye-security InRelease
0.100   Unable to connect to localhost:8080:
0.100 Err:3 http://deb.debian.org/debian bullseye-updates InRelease
0.100   Unable to connect to localhost:8080:
0.101 Reading package lists...
0.105 W: Failed to fetch http://deb.debian.org/debian/dists/bullseye/InRelease  Could not connect to localhost:8080 (127.0.0.1). - connect (111: Connection refused)
0.105 W: Failed to fetch http://deb.debian.org/debian-security/dists/bullseye-security/InRelease  Unable to connect to localhost:8080:
0.105 W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease  Unable to connect to localhost:8080:
0.105 W: Some index files failed to download. They have been ignored, or old ones used instead.

看起来好像它正在尝试通过代理运行,但我不确定为什么。

env | grep -i proxy
是空的。

$ cat ~/.docker/daemon.json
{
 "builder": {
  "gc": {
   "defaultKeepStorage": "20GB",
   "enabled": true
  }
 },
 "experimental": false
}

其他一些信息:

  • 相同的 Dockerfile 在 Linux 上构建得很好
  • docker 构建中的
  • cargo install
    apt get install
    会产生类似的问题。基本上任何在
    Dockerfile
    内访问网络的东西都会尝试通过
    localhost:8080
  • docker pull
    build
    之外的其他docker网络操作没有问题,它们似乎没有使用代理
  • 我尝试过恢复出厂设置并完全卸载/重新安装 docker 桌面

为什么构建可能会失败,看起来像是尝试使用代理?

docker macos docker-desktop
1个回答
0
投票

您可能在“$HOME/Library/Group Containers/group.com.docker/settings.json”中

"overrideProxyHttp": "http://localhost:8080",
© www.soinside.com 2019 - 2024. All rights reserved.