Categories
Miscellaneous Software development

Docker for Windows – mounting shared folders

On how to mount shared drives in Docker for Windows.

Docker has a new offering: “Docker for Windows”.
It was made available during DockerCon 2016 (June) and uses Hyper-Visor instead of VirtualBox.

The resulting user experience is very much like running Docker on Linux.

However playing around with it yesterday I ran into a slight problem:

On a Windows machine, especially a developer-machine, there’s usually some sort of anti-virus software up and running. in my case that’s Norton. And part of the package is a firewall.

This firewall causes problems.

When “Docker for Windows” shares folders it uses SMB. SMB is (at least in the case of Norton Firewall) specifically mentioned as BLOCKED in the firewall rule …. somewhere waay down the list.

So in order for your containers to actually connect – you need to open the firewall .. just a bit.

Looking in the settings (right-click the little whale swimming in your taskbar …). You can see the address and subnet mask.

Docker for Windows Network

The two ports you need to open are
* 139 (netbios-ssn)
* 445 (microsoft-ds)

What you could do is allow that traffic from any IP. But since we already know the range docker will use why not use it?

Resulting rule would be something like “Allow inbound communication on ports.

Here’s all the tabs in Norton Rule editor (which you reach by opening Norton Security Center, click Settings -> Firewall -> Traffic Rules, then “Add”).

DfW-Norton

Note the Rule will be added at the bottom, so you’ll need to select it then click “Move up” until it’s at the top.
Also make sure that there’s a nice blue “X” in the active column.

As always I hope this help someone … and feel free to rant in the comments below.

Remember to restart Docker afterwards.

Testing can be done by running

docker run --rm -v c:/:/data alpine ls /data

16 replies on “Docker for Windows – mounting shared folders”

Thanks for your step by step. It is nice to see a post from someone rather than a pompus reply from someone who doesn’t want to take the time to give a decent answer. Again thank you so much!!

Glad I could help someone. Thanks for commenting. It makes my day everytime 🙂

Thanks so much. This really saved me hours of time that I had spent, instead of turning off my firewall.

Perfect step by step instructions helped to get over this hump.
Thank you so much.

The details of which protocols/ports to open was critically important, and hard to find.

While searching for an answer to this problem, the “official” Docker for Windows site and related postings only describe the nature of the problem, requiring time and effort to understand and sort through the details. Your posting saved hours of effort and frustration as I also use Norton Security. I genuinely appreciate your taking the time to explain this solution so plainly and concisely.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.