I have Docker installed on my Windows OS. There is my volumes filed of docker-compose.yml:
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
I just can't figure out how /var/run/docker.sock::/var/run/docker.sock
path works for windows as I have no /var/run/
on my windows files where I can find docker.sock. So how this volume binding works at all?
The /var/run/docker.sock
file on Docker for Mac and Windows for Linux images is inside the VM that Docker uses to run Linux containers. Those volume mounts happen from inside of that VM to the containers running in the VM. This is also why you can get an empty directory if you try to run a volume mount to a directory that you have not shared with the embedded VM.
You cannot see this file directly from the Windows environment (at least not that I'm aware of), though you can mount it into a container and see it that way.
For more details on how this VM is created, you can see the LinuxKit project: https://github.com/linuxkit/linuxkit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With