Docker Community Forums

Share and learn in the Docker community.

Using the --mount option to mount volumes at runtime fails

I have a very simple Dockerfile…


VOLUME [ "C:\\data" ]

When I try to run the container with the --mount flag it fails…

docker container run --rm --mount type=volume,source=data,target=C:\data test

But if I run it with the -v flag it works…

docker container run --rm -v data:C:\data test