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…

FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-20190521-windowsservercore-ltsc2019

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