There is a problem I have been trying to figure out the cause so that I can fix it.
Context: Windows 10 OS with WSL2 enabled + Ubuntu on Windows v2004.2022.1.0
installed.I have installed docker by these three packages; docker-ce docker-ce-cli containerd.io
. I then used custom overrides in daemon.json
, so that I can access it easily from Windows (browser/IDE);
karel:~$ cat /etc/docker/daemon.json{"hosts": ["unix:///mnt/wsl/shared-docker/docker.sock" ],"registry-mirrors": ["company url" ]}
I also have created a group, docker
, added my user to it and let that group interact with the said socket (see further below). When I started the service, docker runs fine. This is given from /var/log/docker.log
time="2022-08-30T12:06:12.577852700+02:00" level=warning msg="Your kernel does not support cgroup blkio throttle.write_iops_device"time="2022-08-30T12:06:12.578513800+02:00" level=info msg="Loading containers: start."time="2022-08-30T12:06:12.732167500+02:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"time="2022-08-30T12:06:12.807372700+02:00" level=info msg="Loading containers: done."time="2022-08-30T12:06:12.882856700+02:00" level=info msg="Docker daemon" commit=a89b842 graphdriver(s)=overlay2 version=20.10.17time="2022-08-30T12:06:12.883136500+02:00" level=info msg="Daemon has completed initialization"time="2022-08-30T12:06:12.912593800+02:00" level=info msg="API listen on /mnt/wsl/shared-docker/docker.sock"
When I want to attest if I can spin a container, I used docker's hello-world
. This fails with a message that tells me the daemon is not running, despite the service is running.
karel:~$ docker run hello-worlddocker: Cannot connect to the Docker daemon at unix:///mnt/wsl/shared-docker/docker/sock. Is the docker daemon running?.See 'docker run --help'.karel:~$ service docker status * Docker is running
I have a feeling that there's an access mismatch but I don't have an idea how to troubleshoot access management than checking by stat
or ls -l
. I have used stat
on the daemon;
karel:~$ stat /mnt/wsl/shared-docker/docker.sock File: /mnt/wsl/shared-docker/docker.sock Size: 0 Blocks: 0 IO Block: 4096 socketDevice: 14h/20d Inode: 8 Links: 1Access: (0660/srw-rw----) Uid: ( 0/ root) Gid: (36257/ docker)Access: 2022-08-30 12:06:12.245909900 +0200Modify: 2022-08-30 12:06:12.245909900 +0200Change: 2022-08-30 12:06:12.245909900 +0200 Birth: -
The group docker
is a custom group (see above) I've made to add users to it. At this moment, I am the only member of it;
karel:~$ getent group dockerdocker:x:36257:karel
What did I miss? Or am missing? What are the steps I can do to tackle down this problem; that I can spin a docker container?