docs icon indicating copy to clipboard operation
docs copied to clipboard

Document DOCKER_HOST requirement for SDKs on Docker Desktop for Linux

Open varsnotwars opened this issue 4 months ago • 0 comments

Is this a docs issue?

  • [x] My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

Problem

The official Linux install docs now recommend Docker Desktop. After a fresh Desktop install on Linux, the docker CLI works (desktop-linux context), but SDKs and tools that expect /var/run/docker.sock (or an unset DOCKER_HOST) fail with:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock.

Desktop for Linux doesn’t bind /var/run/docker.sock by default; it uses a per-user socket (desktop-linux context). The default context is just the CLI’s legacy placeholder. This is not an issue on macOS or Windows Desktop. Prior user confusion: docker/for-linux#1376.

Reproduction

  1. Install Docker Desktop for Linux from official docs.
  2. docker run hello-world works.
  3. Run Go or Python SDK code (default config) → cannot connect.
  4. export DOCKER_HOST=$(docker context inspect desktop-linux --format '{{ .Endpoints.docker.Host }}') fixes the SDK.

Impact

SDKs and tools fail until users manually export DOCKER_HOST; current docs don’t mention this.

Location

https://docs.docker.com/desktop/

Suggestion

Add a Linux note in:

  • Desktop > Install > Linux (post-install / next steps)
  • Desktop > Troubleshoot > Known issues

Snippet:

export DOCKER_HOST=$(docker context inspect desktop-linux --format '{{ .Endpoints.docker.Host }}')

Explanation: "Docker Desktop for Linux does not bind /var/run/docker.sock by default. It uses a per-user socket (desktop-linux context); SDKs and tools need DOCKER_HOST exported."

Optionally note adding the export to the user’s shell profile and link from language SDK docs.

varsnotwars avatar Aug 26 '25 04:08 varsnotwars