我有以下
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
}
其他一些信息:
cargo install
或 apt get install
会产生类似的问题。基本上任何在 Dockerfile
内访问网络的东西都会尝试通过 localhost:8080
docker pull
和build
之外的其他docker网络操作没有问题,它们似乎没有使用代理为什么构建可能会失败,看起来像是尝试使用代理?
您可能在“$HOME/Library/Group Containers/group.com.docker/settings.json”中
"overrideProxyHttp": "http://localhost:8080",