windows - Error '-systemet kan ikke finde den angivne fil', når du monterer værtsmappe

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg kan ikke få Windows-containere til at starte, når enten mount eller volume er angivet i kommandoen run. Beholdere løber fint uden specifikationen. Jeg har også forsøgt eksplicit at oprette et volumen (Docker administreret) bit stadig få den kan ikke finde fil fejl.


Nedenfor er en af ​​mange variationer jeg har forsøgt at bruge et grundlæggende nanoserverbillede. Kildemappen eksisterer på værten, og jeg har givet fuld kontrol tilladelser i mappen til alle til fejlfinding.


docker run -it --rm --name nanoserver -d microsoft/nanoserver --mount "source=C:HostDataForDockerContainer,target=C:ContainerData"


Fejlteksten:


docker: Error response from daemon: 
container 9f0b1d6ef217986b8c0225fb38e96cbc51db2d3eff79591e9f3d5288f86f2851 encountered an error during CreateProcess: 
failure in a Windows system call: 
The system cannot find the file specified. (0x2) extra info: 
{"CommandLine":"--mount source=C:\HostDataForDockerContainer,target=C:\ContainerData","WorkingDirectory":"C:\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[30,120]}.


Jeg har for nylig opgraderet til den nyeste Docker til Windows-version, men jeg havde ikke prøvet monteringsvolumener tidligere, så jeg ved ikke, om dette er et regressionsproblem med denne Docker-version eller noget, der er isoleret til min værtskonfiguration eller Docker-brug.


Specifikationen mount ser rigtigt ud på mig, men jeg værdsætter, om nogen kan bekræfte.


Min vært maskine er Windows 10 Pro kører Docker Community Edition version 18.03.1-ce-win64 (17438).


EDIT:


Som @JonathonReinhart foreslog, forsøgte jeg at omregne mount valgmuligheden som et tidligere argument og fik den samme fejl, selv om den ekstra information i fejlmeddelelsen antyder ikke alle argumenter blev anerkendt i alle tilfælde. Her er de permutationer, jeg prøvede:


docker run --mount "type=bind,source=C:HostDataForDockerContainer,target=C:ContainerData" -it -d microsoft/nanoserver --rm --name nanoserver
docker: Error response from daemon: 
container f91312790b941a48cea49bb68d939acb648d85a078b30f0a5b74e9e7bae32147 encountered an error during CreateProcess: 
failure in a Windows system call: 
The system cannot find the file specified. (0x2) extra info: 
{"CommandLine":"--rm --name nanoserver","WorkingDirectory":"C:\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[57,120]}.

docker run -it --mount "type=bind,source=C:HostDataForDockerContainer,target=C:ContainerData" -d microsoft/nanoserver --rm --name nanoserver
docker: Error response from daemon: 
container 43fbe911dcd275f55636bd97e4b3498f7c71e265cdda6cb85dacf19bdc8464f1 encountered an error during CreateProcess: 
failure in a Windows system call: 
The system cannot find the file specified. (0x2) extra info: 
{"CommandLine":"--rm --name nanoserver","WorkingDirectory":"C:\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[57,120]}.

docker run -it --rm --name nanoserver -d microsoft/nanoserver --mount "type=bind,source=C:HostDataForDockerContainer,target=C:ContainerData"
docker: Error response from daemon: 
container 14e81f566d2ad45d3103b2e292924eab2b0490f992ae9deaf750b99c25d1ca77 encountered an error during CreateProcess: 
failure in a Windows system call: 
The system cannot find the file specified. (0x2) extra info: 
{"CommandLine":"--mount type=bind,source=C:\HostDataForDockerContainer,target=C:\ContainerData","WorkingDirectory":"C:\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[57,120]}.

docker run -it -d microsoft/nanoserver --mount "type=bind,source=C:HostDataForDockerContainer,target=C:ContainerData" --rm --name nanoserver
docker: Error response from daemon: 
container 20cf5692417a9d455dd4a05ff77516dc4f17d4b0d9cc8c37d29dc842b82f5007 encountered an error during CreateProcess: 
failure in a Windows system call: 
The system cannot find the file specified. (0x2) extra info: 
{"CommandLine":"--mount type=bind,source=C:\HostDataForDockerContainer,target=C:\ContainerData --rm --name nanoserver","WorkingDirectory":"C:\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[57,120]}.

docker run -it -d microsoft/nanoserver --rm --mount "type=bind,source=C:HostDataForDockerContainer,target=C:ContainerData" --name nanoserver
docker: Error response from daemon: 
container fba579fa3d788f4890b0c1523495742b689513150800e1b19f6f70f2a0e49819 encountered an error during CreateProcess: 
failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: 
{"CommandLine":"--rm --mount type=bind,source=C:\HostDataForDockerContainer,target=C:\ContainerData --name nanoserver","WorkingDirectory":"C:\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[57,120]}.

docker run -it -d microsoft/nanoserver --rm --name nanoserver --mount "type=bind,source=C:HostDataForDockerContainer,target=C:ContainerData"
docker: Error response from daemon: 
container 76b1117b65e6e345284c083af39fa8a627369fb5518fe89ed2519aa224f82d0a encountered an error during CreateProcess: 
failure in a Windows system call: The system cannot find the file specified. (0x2) extra info: 
{"CommandLine":"--rm --name nanoserver --mount type=bind,source=C:\HostDataForDockerContainer,target=C:\ContainerData","WorkingDirectory":"C:\","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[57,120]}.

Bedste reference