-volume option for whole disk -v f:\:f:\ gets error

Want to share a whole disk with the container. started like this:

docker run -it -v f:\:f:\ microsoft/mssql-server-windows-developer cmd

Got error:

docker: Error response from daemon: container 033e5b344e96ab0a4335de4bb8a3b34f344a01ed10f8f0abe02df23c78731b8c encountered an error during Start: failure in a Windows system call: The compute system exited unexpectedly. (0xc0370106).

What should I do?

Use the --volume type=bind,source,dest

The : is confusing the -v option. Colon is the source/dest separator with -v

I tried this:

docker run -it --volume type=bind,src=f:\,dst=f:\ microsoft/mssql-server-windows-developer cmd

Got:

docker: Error response from daemon: invalid bind mount spec “type=bind,src=f:\,dst=f:\”: invalid volume specification: 'type=bind,src=f:,dst=f:'.
See ‘docker run --help’.

The docs at https://docs.docker.com/engine/reference/commandline/run/

show this:

PS C:\> docker run -v c:\foo:d: microsoft/nanoserver cmd /s /c type d:\somefile.txt
Contents of file

so I tried

docker run -it -v f:\:f: microsoft/mssql-server-windows-developer cmd

But that caused the same error as before

docker: Error response from daemon: container cb40d93ef5ae53f0b3b8061bd6eaaf559b03f825c9a323ee7c9767c0b5ea1836 encountered an error during Start: failure in a Windows system call: The compute system exited unexpectedly. (0xc0370106).

Am I getting the syntax wrong? Or is something else happening?

i think you might have to change the f:\ to f:/ as the \ seems to be removed.

I’m afraid that’s not it. I tried all combos of no-slash, fwd-slash, back-slash. Same error on all of them:

Error response from daemon: invalid bind mount spec