Skip to content

Unable to mount docker.sock #4471

@XhstormR

Description

@XhstormR

Description

I'm using a rootless Docker container template, and when I run docker-compose, it shows an error message saying it can't mount docker.sock:
Error response from daemon: error while creating mount source path '/Users/user/.lima/default/sock/docker.sock': mkdir /Users/user/.lima/default/sock/docker.sock: operation not supported

The following configuration has been added:

mounts:
  - location: "~/"
    writable: true

sample docker-compose.yml:

services:
  traefik:
    image: "traefik:v3.6"
    container_name: "traefik"
    command:
      #- "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entryPoints.web.address=:80"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/Users/user/.lima/default/sock/docker.sock:/var/run/docker.sock:ro"

  whoami:
    image: "traefik/whoami"
    container_name: "simple-service"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoami.rule=Host(`whoami.localhost`)"
      - "traefik.http.routers.whoami.entrypoints=web"
──❯ docker-compose up
[+] up 3/3
 ✔ Network aaaa_default     Created       
0.0s
 ✔ Container traefik        Created         
0.1s
 ✔ Container simple-service Created          
0.1s
Attaching to simple-service, traefik
simple-service  | 2025/12/18 10:45:27 Starting up on port 80
Error response from daemon: error while creating mount source path '/Users/user/.lima/default/sock/docker.sock': mkdir /Users/user/.lima/default/sock/docker.sock: operation not supported
└──❯ ls -l ~/.lima/default/sock/docker.sock
0600 srw-------@ - user staff - 2025-12-18 13:30  /Users/user/.lima/default/sock/docker.sock=
└──❯ docker info 
Client:
 Version:    29.1.3
 Context:    lima-default
 Debug Mode: false

Server:
 Containers: 5
  Running: 1
  Paused: 0
  Stopped: 4
 Images: 9
 Server Version: 29.1.1
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: systemd
 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: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 1c4457e00facac03ce1d75f7b6777a7a851e5c41
 runc version: v1.3.4-0-gd6d73eb8
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  rootless
  cgroupns
 Kernel Version: 6.8.0-88-generic
 Operating System: Ubuntu 24.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 3.822GiB
 Name: lima-default
 ID: aa033888-4eb9-4ec5-8580-ba4980bd654a
 Docker Root Dir: /home/user.linux/.local/share/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Firewall Backend: iptables

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions