2016-10-30 6 views
1

サンプルディレクトリをユーザーディレクトリに作成し、Docker Containerにマウントして動作させました。下記の出力を参照してください:私はCドライブ上dockertestというフォルダ内の同じディレクトリをコピー/ペーストした場合Cドライブにフォルダをマウントすることができませんボリューム

[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 

を、それがエラーの下に取得する:

[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 

私はここで何かが足りないのですか?


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

2番目のケースでどのような違いがあったのでしょうか? – Rao

+0

ExpressSiteフォルダの場所。最初の実行コマンドでは、それは私のホームディレクトリにあり、2番目のコマンドはC:\ dockertestにあります – Asdfg

+0

そのフォルダに 'package.json'が含まれていますか?あなたはそのフォルダの中からコマンドを実行していますか? 'npm-debug.log'は実行時に作成されていますか? – Rao

答えて

2

た(あなたがDocker for Windows(64ビット版のWindows 10のPro、Enterpriseおよび教育(1511年11月の更新は、10586以降の構築が必要)およびMicrosoft Hyper-V)を使用して、およびない古いDocker Toolboxしていることを確認しますOracleの仮想ボックスの代わりに、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を参照してください。
例えば 、このcomment mentions:Windows用ドッカーで使用する場合

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 

は多分これはbashのセッションのbashrcには存在しません。

関連する問題