I have the following Dockerfile
:
FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y cmake
I’ve installed Docker Desktop on Mac via brew install --cask docker
. When I run docker build .
, it fails with:
> [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.
It appears as though it is trying to run through a proxy, but I’m not sure why. env | grep -i proxy
is empty.
$ cat ~/.docker/daemon.json
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false
}
A few other bits of info:
- The same Dockerfile builds fine on Linux
cargo install
orapt get install
in a docker build produces a similar issue. Basically anything that hits the network inside aDockerfile
tries to go throughlocalhost:8080
docker pull
and other docker network operations outside ofbuild
do not have a problem, they don’t appear to be using a proxy- I’ve tried a factory reset and a full uninstall/reinstall of docker desktop
Why might builds be failing in a way that looks like it is trying to use a proxy?
2
Answers
docker buildx ls
returned:After running
docker context use default
, builds no longer act as though they run through a proxy. I'm not sure where thedesktop-linux
builder came from, but it seems that the proxy config was somehow baked into that.You might have in "$HOME/Library/Group Containers/group.com.docker/settings.json"