Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to share a local windows path with a container in Docker

New to Docker, and running Docker Toolbox on Win 10 x64.

I'm trying to share (mount) a local Windows path with a container (Portainer in this case) so that the container will save all of it's config settings, locally on my PC, so that I can always upgrade the container while still having it's configuration persistant.

I have read/watched many tutorials, reference, docs, vids, etc., I'm trying to do what they seem to explain to do, but when I create the container with the local path mounted and then go into the container, set some config settings, and then look at the windows path I had mounted, there's nothing being saved there.

Not sure what the problem is?

Here's an example docker cmd I'm running:

docker run -it -v /c/Servers/DockerConfigs/Portainer:/data :P portainer/portainer

To my understanding, whatever gets stored in the /data folder in the container should also get saved to the Windows folder on the host C:\Servers\DockerConfigs\Portainer, but nothing is getting saved to that windows folder ...

I've also tried copying some files on the host to that windows folder, and then within the container viewing the /data folder to see if they show up using ls -a but again, nothing shows up in there ...

Anyone know what I'm missing?

like image 645
J. Scott Elblein Avatar asked Oct 27 '22 20:10

J. Scott Elblein


1 Answers

Make sure that the C drive is enabled for sharing: Right click on the whale icon -> Settings -> Shared Drives. Also consider using the newer Docker Desktop for Windows.

like image 153
Chris Avatar answered Nov 18 '22 12:11

Chris