I’ve looked at a few similar issues and bugs online, but so far none of them have helped. What’s the correct way to mount a volume in a container running on Docker for Windows? I’m running Docker 18.06.1-ce on Windows 10 (Latest). First, I create a local directory called C:\DeleteMe, and did a docker pull hello-world for testing. I would like to mount the contents of DeleteMe in a directory on the container called Data.
I first tried:
docker run -it -v C:\DeleteMe:/Data hello-world cmd
But I got back:
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error
response from daemon: invalid volume specification:
‘C:\DeleteMe:/Data’. See ‘C:\Program
Files\Docker\Docker\Resources\bin\docker.exe run --help’.
And about every other variety I could think of with various front slashes and back slashes for each. All have the same error message.
I’ve also tried the --mount syntax:
docker run -it --mount source=C:\DeleteMe,target=/Data hello-world cmd
And got a similar error:
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error
response from daemon: invalid mount config for type “volume”: invalid
mount path: ‘/Data’. See ‘C:\Program
Files\Docker\Docker\Resources\bin\docker.exe run --help’.