Docker Community Forums

Share and learn in the Docker community.

Mounted new volumes don't migrate already present data

Hey together!

I am trying to get a simple windows postgreSQL container with external volume running…
The container itself runs perfectly on its own.

But when i want to shift the DATA directory to a docker volume, it always turns out empty.

According to https://docs.docker.com/storage/volumes/ - “Populate a volume using a container”,
it should migrate the content of C:\DATA to a new volume and mount it in the directorys place, but if i run:

docker run -it --entrypoint cmd --name pgtest --mount source=pgvol,target=C:/DATA pg

the directory C:\DATA is suddenly empty and postgres crashes…

I can’t find anything related in dockers logfile.

On researching this issue i only find this one: https://github.com/docker/for-win/issues/3499,
which is about mounting a host machine folder into a container…

Could someone confirm this behavior, or has an idea if i am doing something wrong?

Best Regards,
Johann