The answer is yes, you can use the exact same procedure, bind-mounting the exact same socket as on Linux or Mac, to achieve exactly the same effect. I apologize for posting before I actually tried it out!
You have to understand the structure of what Docker for Windows provides. It uses the Windows hypervisor that was introduced (and only available) in Windows 10 to run a VM. I believe it’s Alpine Linux running in that VM, but I’m by no means certain. That VM is what runs the Docker client, contains the images and containers, etc. The whole point of Docker for Windows is to make this process transparent and easy to utilize, but its success here has lead to some confusion, as you and I have both experienced.
So /var/run/docker.sock exists inside of the Linux VM, not anywhere on your Windows computer. There’s also a command-line client that is installed in Windows-land that passes commands to the VM, and outputs data that it gets back from it. When you tell it to mount the docker socket from your Windows command line, it doesn’t really do anything in Windows. The command is passed to the VM, which then mounts the socket for access by the containers.
Barring other problems with your installation or Docker itself, you should be able to run the “docker run” command suggested in the docker-ssh project readme without issue. If that’s not the case, post the error you’re getting and then we can try to resolve it.
Yup, that’s about what I expected to see. So, troubleshooting an SSH connection refused error is your next step, and there’s a lot of good posts on the topic on Ubuntu forums, and Stack Overflow. Google is your friend. If the problem is specific to the docker-ssh project, raise the issue with the maintainer. I think it more likely that there’s a configuration problem somewhere with your system.
Thanks ~ You really have helped me.
I have found the problem and try to solve it.
Finally after your tips, I found it is not a problem.
Just mount /var/run/docker.sock to our container is OK!
Haha, we want to solve a problem which is not a real problem.
After a day lost trying to simulate my CI environment I came across this. Thank you, thank you!! Simply adding another -v /var/run/docker.sock:/var/run/docker.sock volume to my docker run command allowed the Docker daemon to magically run inside the parent container!