Mapping Docker volumes on Windows with Links

We use Docker whenever possible. You should, too, it’s really awesome.

Recently I’ve installed Docker on a new computer, and noticed all our containers stopped working properly there. They couldn’t map any of the volumes we were mapping. After careful investigation we’ve realized the problem was Windows links.

All of our office computers have a small SSD system drive C:, and a large magnetic drive D: . We use links to map directories from D: to C:. Specifically, we have a Sources directory for each user – C:\user\someone\Sources that is actually a link to D:\UserData\someone\Sources . We usually map our volumes from C:\user\someone\Sources\… , and these mounts failed. Miserably.

We were able to map files and directories from C:, and we were able to mount files from D:, so these weren’t permission issues, the only problem was with mapping paths from C:\…\Sources . Only on one computer.

Turns out we haven’t created the link properly! We have created a soft link using mklink /d C:\...\Sources¬† D:\...\Sources. Docker can’t handle those. We needed to change our link to a directory junction instead, using mklink /j C:\...\Sources D:\...\Sources . Once we’ve done that, Docker started working again.

Leave a Comment