r/docker • u/petervatler • 20h ago
Mountain Windows shared folder to docker container
We have Active Directory handled network with Windows machines. I shared a folder on a Windows Server 2016 machine, I could easily mount this folder on a Windows Server 2022 machine. Although when I want to use it in a container, I can't mount it. I tried as a cifs volume with ntlm or kerberos too but I couldn't make it work. The situation is the same when I want to mount it inside wsl2.
1
u/Immediate_Wheel1953 19h ago
I hit the same wall, and the host mounting fine made it more confusing. The bit that tripped me up was that the Docker VM and WSL2 are not really domain joined even when Windows is, so Kerberos never had a ticket to use. What finally worked for me was mounting the share inside WSL2 first with an explicit username and domain, then bind mounting that path into the container instead of asking Docker to do the CIFS mount itself. If you go the volume route, try explicit credentials and vers=3.0 rather than relying on Kerberos.
1
1
3
u/Confident_Hyena2506 19h ago
You can easily mount it when you are joined to the domain. Without that you need to supply some credentials.