After years I am now migrating my development environment from vagrant to docker. I was always very pleased about the way vagrant worked but running a complete VM is a bit of overhead and beside that very resource consuming. It’s also less flexible, its more work to maintain for example. After reading about Linux Containers, how they work I got interested in Docker. Now I am working on my own docker development environment. While I am building such environment I experience sometimes difficulties, some easy to overcome and some harder. Today I had an issue with mounting volumes from my windows machine using docker compose. The problem was that the mount just didn’t work. So what is the problem?
When I try to mount a volume on my windows machine it won’t show up in my docker container. The directory to which a mount in the docker container remains empty.
The problem was caused by my Kaspersky firewall. It was blocking port 445 for local TCP services. Therefor docker had no access to my shared drives.
First open your docker settings in windows and make sure you have selected the drive from which you want to share volumes:
If I tried to share the drive D I got an error:
A firewall is blocking file sharing between Windows an the containers. See documentation for more info.
It’s my firewall who is blocking this. In my case D was already selected but I still got the issue. After deselecting it, saving it, and selecting it again I got the above error. I solved it by allowing port 445 for local TCP services in my Kaspersky firewall.
Remove port 445 from the list and everything should work as expected again.