When I first start VS Code, it loads into a devcontainer with alpine docker outside docker. When I run docker container ls, it says Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Upon checking /run, I see that docker.sock and docker-host.sock both exist, however using readlink -f /run/docker.sock indicates that docker.sock isn't linked.
total 12
drwxr-xr-x 1 root root 4096 Feb 12 10:44 .
drwxr-xr-x 1 root root 4096 Feb 12 10:44 ..
srw-rw---- 1 root ping 0 Feb 13 04:34 docker-host.sock
srw-rw---- 1 user root 0 Feb 12 10:44 docker.sock
drwx--x--x 2 root root 4096 Jan 30 07:31 sudo
If I then run sudo rm /run/docker.sock and sudo ln -s /run/docker-host.sock /run/docker.sock and fix permissions, I can correctly run docker commands.
Interestingly, if I run the VS Code task, "Dev Containers: Rebuild Container", Docker will be working correctly on the second boot, just not the first.
When I first start VS Code, it loads into a devcontainer with alpine docker outside docker. When I run
docker container ls, it saysCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?Upon checking
/run, I see that docker.sock and docker-host.sock both exist, however usingreadlink -f /run/docker.sockindicates that docker.sock isn't linked.If I then run
sudo rm /run/docker.sockandsudo ln -s /run/docker-host.sock /run/docker.sockand fix permissions, I can correctly run docker commands.Interestingly, if I run the VS Code task, "Dev Containers: Rebuild Container", Docker will be working correctly on the second boot, just not the first.