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 Desktop 4.13] Cannot bind mount new docker.sock location (user home) to /var/run/docker.sock #6545
Comments
I think you should be able to use |
Yes, that does work. I can create a symlink from /var/run/docker.sock to $HOME/.docker/run/docker.sock. Then I can run But I want to eventually be able to support the new location for docker desktop ($HOME/.docker/run/docker.sock), but for clis running inside of dind (k3d) I want them to be able to use |
I don't think the path on the host is needed; docker desktop has special handling for /var/run/docker.sock (separate from whatever location it's accessible at on the host), as you'd want to mount it from within the VM into the container |
Hmm, interesting idea. Maybe I'm mis understanding something but I just tried these with no luck |
The intuitive way to think about it is that there are three filesystems - the host and the vm and the container. Docker Desktop has some cleverness to mount the vm's docker socket. We need to follow-up to figure out if you should be able to mount the ~/.docker/run/docker.sock ... |
Hey @nicks so the architecture of our dev experience for our customers is that we embed a bunch of "cluster tools" inside of a docker container, and those tools need access to the docker daemon on the host (so k3d can start a k3s cluster). We also run I would love to get your feedback on our approach. |
@gamerson That's a good approach! It's the exact approach we're trying to make easier. Please let us know if you run into any additional difficulties with it. |
hey @nicks I'm glad to hear our approach isn't "out of bounds". :) As long as we will have a supported/approved way going forward (mounting the host socket from containers) I'm happy and I'll mark this issue as closed. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. /lifecycle locked |
Expected behavior
I can run
docker run -it -v ${HOME}/.docker/run/docker.sock:/var/run/docker.sock [IMAGE] bash
and then inside my container I can run a command likedocker ps
ork3d cluster list
or some other CLI that tries to communicate with the docker daemon on my host.Actual behavior
I get the following error:
However, if I create a symlink from $HOME/.docker/run/docker.sock to /var/run/docker.sock and then execute this command
docker run -it -v /var/run/docker.sock:/var/run/docker.sock [my-image-that-has-docker] docker ps
It now works:
Is there something different about setting up a bind map from
${HOME}/.docker/run/docker.sock
and/var/run/docker.sock
?Thanks in advance!
The text was updated successfully, but these errors were encountered: