Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Outside Docker: /run/docker.sock sometimes not linked to /run/docker-host.sock #78

Open
PseudoResonance opened this issue Feb 13, 2025 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@PseudoResonance
Copy link

PseudoResonance commented Feb 13, 2025

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.

@cirolosapio cirolosapio added bug Something isn't working help wanted Extra attention is needed labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants