Skip to content

docker-mcp fails on Ubuntu due to incorrect socket path #6128

Closed
@vanisoul

Description

@vanisoul

Description

Description

When running the following command on Ubuntu with Docker Desktop installed:

~/.docker/cli-plugins/docker-mcp gateway run

It fails with the following error:

reading secrets: finding secrets []: exit status 125

Root Cause (via strace)

Using strace, I found that the CLI tries to access the following socket path:

~/Library/Containers/com.docker.docker/Data/docker.raw.sock

This path appears to be other-os-specific. On Ubuntu, the actual socket is located at:

~/.docker/desktop/docker.raw.sock

Workaround

To resolve the issue, I created a symbolic link that mimics the path:

mkdir -p ~/Library/Containers/com.docker.docker/Data/
cd ~/Library/Containers/com.docker.docker/Data/
ln -s ../../../../.docker/desktop/docker.raw.sock docker.raw.sock

After this, docker-mcp gateway run works as expected.

Expected Behavior

The CLI plugin should correctly detect platform-specific socket paths (e.g., Linux vs macOS), or allow configuration/override of the socket path.

Environment

  • OS: Ubuntu 22.04
  • Docker CLI Version: Docker version 28.2.2, build e6534b4
  • Docker Daemon Version: Docker version 28.2.2, build 45873be
  • Docker Desktop Version: Docker Desktop 4.42.0 (195023)
  • docker-mcp Plugin Version: dev, commit cb67dfd17ba46115f13869a87d5449e6a78110b1

Reproduce

  1. Install Docker Desktop on Ubuntu
  2. docker mcp gateway run

reading secrets: finding secrets []: exit status 125

Expected behavior

The CLI plugin should correctly detect platform-specific socket paths (e.g., Ubuntu).

docker version

Client: Docker Engine - Community
 Version:           28.2.2
 API version:       1.50
 Go version:        go1.24.3
 Git commit:        e6534b4
 Built:             Fri May 30 12:07:27 2025
 OS/Arch:           linux/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.42.0 (195023)
 Engine:
  Version:          28.2.2
  API version:      1.50 (minimum version 1.24)
  Go version:       go1.24.3
  Git commit:       45873be
  Built:            Fri May 30 12:07:26 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.27
  GitCommit:        05044ec0a9a75232cad458027ca83437aae3f4da
 runc:
  Version:          1.2.5
  GitCommit:        v1.2.5-0-g59923ef
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    28.2.2
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  ai: Docker AI Agent - Ask Gordon (Docker Inc.)
    Version:  v1.4.0
    Path:     /home/bevis/.docker/cli-plugins/docker-ai
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.24.0-desktop.2
    Path:     /home/bevis/.docker/cli-plugins/docker-buildx
  cloud: Docker Cloud (Docker Inc.)
    Version:  v0.3.9
    Path:     /home/bevis/.docker/cli-plugins/docker-cloud
  compose: Docker Compose (Docker Inc.)
    Version:  v2.36.2-desktop.1
    Path:     /home/bevis/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.41
    Path:     /home/bevis/.docker/cli-plugins/docker-debug
  desktop: Docker Desktop commands (Docker Inc.)
    Version:  v0.1.9
    Path:     /home/bevis/.docker/cli-plugins/docker-desktop
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.29
    Path:     /home/bevis/.docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.4.0
    Path:     /home/bevis/.docker/cli-plugins/docker-init
  mcp: Docker MCP Plugin (Docker Inc.)
    Version:  dev
    Path:     /home/bevis/.docker/cli-plugins/docker-mcp
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /home/bevis/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.18.1
    Path:     /home/bevis/.docker/cli-plugins/docker-scout

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 1
 Server Version: 28.2.2
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: active
  NodeID: ljswm0urxswzwzf3ugvp0k7ld
  Is Manager: true
  ClusterID: kp1jg8masrt7bxdqy4s4fjrho
  Managers: 1
  Nodes: 1
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 192.168.65.9
  Manager Addresses:
   192.168.65.9:2377
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
 runc version: v1.2.5-0-g59923ef
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.10.14-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 5.575GiB
 Name: docker-desktop
 ID: 3b1f6e89-6f78-412b-8cd2-1564080c1b4c
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Username: ga2006088445
 Labels:
  com.docker.desktop.address=unix:///home/bevis/.docker/desktop/docker-cli.sock
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: DOCKER_INSECURE_NO_IPTABLES_RAW is set

Additional Info

trace.log

47350 connect(3, {sa_family=AF_UNIX, sun_path="/home/bevis/Library/Containers/com.docker.docker/Data/docker.raw.sock"}, 72) = -1 ENOENT (No such file or directory)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions