简体   繁体   中英

Docker for Windows 10 and Volume

All,

I'm learning Docker on my Windows Desktop 10. Windows is Pro edition and Docker is 18.09.

When I run the below -

docker run -it nanoserver/iis -v C:\\ProgramData\\Docker\\volumes\\vol01:C:\\vol01 cmd.exe

I get the below error -

docker: Error response from daemon: container 5a1229eca277cbddeefd5637e69554458003c54be3f30cc44ca41c8fa68a4a94 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) [Event Detail: Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"-v C:\\ProgramData\\Docker\\volumes\\vol01:C:\\vol01 cmd.exe","WorkingDirectory":"C:\\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[63,237]}.

The volume does exist -

docker volume inspect vol01

[ { "CreatedAt": "2018-12-26T03:01:01-05:00", "Driver": "local", "Labels": {}, "Mountpoint": "C:\\ProgramData\\Docker\\volumes\\vol01\\_data", "Name": "vol01", "Options": {}, "Scope": "local" } ]

I don't know what is wrong. Can someone point me in the right direction?

Thanks, rgn

You should declare volumes before image name for docker run . Consider:

docker run -it -v C:\ProgramData\Docker\volumes\vol01:C:\vol01 nanoserver/iis cmd.exe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM