Tecnativa / Tecnativa/docker-socket-proxy

503 with docker-desktop on Mac

Open
#92 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.8k
Forks
207
PR merge metrics
No merged PRs in 30d

Description

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"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with Docker Desktop 4.20.1 using the docker context-derived socket, docker-socket-proxy, and DOCKER_HOST=tcp://127.0.0.1:2375. Compare it with the working hard-coded /var/run/docker.sock setup and trace the source of the HTTP 503; done means the context-provided socket works through the proxy without the crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.