Hi,
I’m trying to figure out how to use volumes to persist data for my container. I’m using Docker Desktop for Windows 4.14.1 over Engine Version: 20.10.21 on Windows 11 against Windows Containers.
-
I’ve created a volume
“docker volume create -d local --label srtdata --name srtdata” -
I then run my container and mount the volume
‘docker run myorg/myimage -v srtdata:C:/srtdata/’
which creates my new container using myimage (which is a windows-based image). This works great. I can Terminal to my running container and I can see there is C:\srtdata\
I then MKDIR c:\srtdata\foo\
this works great.
I then stop my container. Next I rerun the command
‘docker run myorg/myimage -v srtdata:C:/srtdata/’
which starts another container. I open Terminal, and "dir \srtdata' and it’s empty
Why don’t new containers preserve the data in my srtdata volume?
Thanks