Mount virtual volume to Docker container on Windows 10


I’m running Docker over Windows 10 with native virtualization.
I need to run a Gitlab image, but I need that the main folder (/var/opt/gitlab) was placed out of Docker Moby VHD, however, the filesystem must be ext4 (or any permission based) and this cannot be mounted on Windows.

Do you know if there is some other way to mount a linux drive or a VHD image on the container from Windows?

Thank you very much.

Why do you need the volume to be out of Moby? You can use a named volume, that will stay around even as you stop and start your gitlab container:

Yes, I’m using named volumes, but they are all into Moby virtual disk, what if I want backup or move one of them, or get quick access to the content (with Docker turned off, of course), and what if whole Moby virtual disc corrupts, I think it would be good to have the different data scopes into different places.

Thank you for your quick answer.

To do a backup, you can start a container with the volume attached and docker cp out the contents:

1 Like

Ok, there is no easy way to do what I want :man_facepalming:.
I’m going to take the cp solution.

Thank you for your time! :grinning: