I am experiencing a persistent issue with the Docker provider in Traefik v3.x (v3.0, v3.2, v3.4) running on macOS via Docker Desktop. The container fails to retrieve information from the Docker daemon, repeatedly logging an empty error message.
Environment:
- OS: macOS (Darwin arm64)
- Docker Desktop: v4.54.0 (212467)
- Docker Engine: v29.1.2 (API v1.52, Min v1.44)
- Traefik Version: v3.2 (and v3.0, v3.4)
Issue:
Traefik v3.x fails to connect to the Docker socket with the following error loop:
ERR Failed to retrieve information of the docker client and server host error="Error response from daemon: " providerName=docker
Steps taken / Debugging results:
1. Validated socket mount: The socket is mounted correctly at /var/run/docker.sock and is accessible inside the container (verified with `ls -l` and `curl` inside the container
2. API Version: Manually tested the socket with `curl` inside the container.
- `curl --unix-socket /var/run/docker.sock http://localhost/v1.44/version` returns 200 OK.
- `curl --unix-socket /var/run/docker.sock http://localhost/version` returns 200 OK.
- `curl --unix-socket /var/run/docker.sock http://localhost/v1.24/version` returns 400 Bad Request (Docker Desktop rejects legacy API calls).
3. Configuration attempts:
- Tried setting `DOCKER_HOST=unix:///var/run/docker.sock`
- Tried forcing `DOCKER_API_VERSION=1.44` (and 1.41, 1.45)
- Tried using `tecnativa/docker-socket-proxy`
- Removed `security_opt: no-new-privileges`
4. Comparison: Traefik v2.11 works perfectly with the exact same socket mount and configuration, successfully discovering services.
It appears the Docker client library in Traefik v3 is either attempting to negotiate an API version that Docker Desktop rejects (e.g., v1.41 or lower) or is mishandling the response from the daemon, resulting in the empty error message.
Has anyone successfully run Traefik v3 with the Docker provider on recent versions of Docker Desktop for Mac?