Skip to content

bug: DOCKER_HOST environment variable is ignored in Rootless Docker mode #21

@taker1974

Description

@taker1974

Description

The Docker MCP server fails to connect to the Docker daemon in Rootless mode because it strictly expects the socket at /var/run/docker.sock, ignoring the DOCKER_HOST environment variable.

Environment

  • Docker Mode: Rootless
  • DOCKER_HOST: unix:///run/user/1000/docker.sock
  • MCP Host: Cursor / npx

Steps to Reproduce

  1. Run the server in a Rootless Docker environment where the socket is located at $XDG_RUNTIME_DIR/docker.sock.
  2. Provide DOCKER_HOST via the env block in mcp.json or via shell.
  3. The server fails with: Error: connect ENOENT /var/run/docker.sock.

Expected Behavior

The server should respect the DOCKER_HOST environment variable or provide a configuration flag (e.g., --socketPath) to specify a custom socket location.

Actual Behavior

The server hardcodes the connection to /var/run/docker.sock, making it unusable in Rootless environments without root-level symlinks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions