Windows docker compose file volume mapping

I am running Docker Desktop for Windows on Windows 11 with WSL2.
The compose file that I have from a third party has volume mapping that looks so:

- "/someDir/:/configuration"

The third party runs their docker on a linux distribution but I am running on windows.

Should I be able to reference the /someDir folder within the Ubuntu distribution I installed for Docker? I thought this was the case (and maybe the whole point of having it installed) but the app ends up getting a permission denied error when it tries to create a subdirectory under /configuration.

Maybe this is a problem with the user that it runs as not having permission to create the subdirectory or I may be misunderstanding something more fundamental about docker running on windows.

Apologies if this isn’t the place to post the question.


If it is not a private image, please, share what image you are using. Permission denied error is normal when the user in the container is not root so it can’t create a folder when it doesn’t have rpermission in the parent. If you bind mount a folder (that is what you did) you need to make sure the folder on the host is properly configured so the user in the container can do what it needs to do with it.

The documentation can be useful too especially when you want to mount a folder from Windows, but if you can do it from another WSL distribution, that’s better.

You can also create a volume instead of mounting a fodler from the host:

So the permissions will be automatically set, but then you can acidentally remove the volume that’s why I use it only for testing and for temoporary folders not for peristent data in production. At least not the “local” volumes…