2016-10-30 3 views
1

mounten Ich erstellte eine Beispiel-Express-Site in meinem Benutzerverzeichnis und montiert es auf einem Docker-Container und es funktioniert. Bitte beachten Sie die folgende Ausgabe:Konnte keinen Ordner auf C-Laufwerk als Volume

[email protected] MINGW64 ~/ExpressSite 
$ docker run -p 8080:3000 -v $(pwd):/var/www1 -w "/var/www1" node npm start 
npm info it worked if it ends with ok 
npm info using [email protected] 
npm info using [email protected] 
npm info lifecycle [email protected]~prestart: [email protected] 
npm info lifecycle [email protected]~start: [email protected] 

> [email protected] start /var/www1 
> node ./bin/www 

Wenn ich Kopieren/das gleiche Verzeichnis in einem Ordner einfügen namens dockertest auf Laufwerk C, es unten Fehlermeldung erhalten:

[email protected] MINGW64 /c/dockertest/ExpressSite 
$ docker run -p 8080:3000 -v $(pwd):/var/www1 -w "/var/www1" node npm start 
npm info it worked if it ends with ok 
npm info using [email protected] 
npm info using [email protected] 
npm ERR! Linux 4.4.27-boot2docker 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 
npm ERR! node v7.0.0 
npm ERR! npm v3.10.8 
npm ERR! path /var/www1/package.json 
npm ERR! code ENOENT 
npm ERR! errno -2 
npm ERR! syscall open 

npm ERR! enoent ENOENT: no such file or directory, open '/var/www1/package.json' 
npm ERR! enoent ENOENT: no such file or directory, open '/var/www1/package.json' 
npm ERR! enoent This is most likely not a problem with npm itself 
npm ERR! enoent and is related to npm not being able to find a file. 
npm ERR! enoent 

npm ERR! Please include the following file with any support request: 
npm ERR!  /var/www1/npm-debug.log 

Bin ich hier etwas fehlt?


[email protected] MINGW64 /c/dockertest/ExpressSite 
$ ls 
app.js bin/ node_modules/ package.json public/ routes/ views/ 
+0

Konnte nicht, welchen Unterschied im zweiten Fall gemacht wurde? – Rao

+0

Speicherort des ExpressSite-Ordners. Beim ersten Startbefehl befindet er sich in meinem Home-Verzeichnis und im zweiten bei C: \ dockertest – Asdfg

+0

Enthält dieser Ordner 'package.json'? Führen Sie den Befehl innerhalb dieses Ordners aus? 'npm-debug.log' wird zur Laufzeit erstellt? – Rao

Antwort

2

Stellen Sie sicher, Docker for Windows verwenden (erfordert 64-Bit-Windows-10 Pro, Enterprise und Bildung (1511 Update November, Build 10586 oder höher) und Microsoft Hyper-V), und nicht die alte Docker Toolbox (die verwendet Oracle Virtual Box anstelle von Hyper-V)

https://cloud.githubusercontent.com/assets/7180398/18270828/3b385b82-742f-11e6-8c74-eb55d73b0b0a.png

I used the little whale icon in the taskbar to go to a settings/shared drives screen.
I checked off the C drive and clicked Apply . It made me enter my windows credentials.
I reset docker from the Settings menu after this change.

issue 18756 für mehr sehen.
Zum Beispiel diese comment mentions:

For a mingw bash shell, this is what docker toolbox adds (for example in bashrc) to stop mingw from corrupting the paths:

docker() { 
    MSYS_NO_PATHCONV=1 docker.exe "[email protected]" 
} 
export -f docker 

Vielleicht ist das in der bashrc einer Bash-Sitzung nicht anwesend, als mit Docker für Windows verwendet.

Verwandte Themen