docker-socket-proxy
docker-socket-proxy copied to clipboard
503 with docker-desktop on Mac
With docker-desktop 4.20.1 on Mac, the following crashes with a HTTP 503 error:
# get the location of the currently active docker socket, will be something like $HOME/.docker/run/docker.sock
#
socket="$(docker context ls --format '{{.Current}}\t{{.DockerEndpoint}}' | awk '$1 == "true" { print $2 }')"
socket="${socket#unix://}"
# run the socket proxy
#
docker run -p 2375:2375 -v "${socket}:/var/run/docker.sock:ro" -d --rm tecnativa/docker-socket-proxy
# make a call to the proxy: this crashes
#
DOCKER_HOST=tcp://127.0.0.1:2375 docker ps
Hard-coding socket=/var/run/docker.sock
works fine, but shouldn't there be a way to respect the socket location provided by the docker context?
Other approaches I tried which didn't work:
- Adding
--privileged
to the docker run command: same crash with a 503 - Adding
--user $UID:$GID
to the docker run command: container fails to start with error "Cannot create pidfile /run/haproxy.pid"