Expected behavior
Docker container spins up with mounted volume and command run in working dir
Actual behavior
Docker container spins up but cannot run command in working directory due to volume not mounting
Information
I think this is an issue related to others I’ve seen with Windows path/filesystem quirks but I can’t figure out the magic combination.
I have both my C: and E: drive shared though Docker for Windows and I turned on File & Print Sharing for guest and public networks.
I have the same folder contents in both the C: and E: paths below.
Steps to reproduce the behavior
These all result in the same output below
docker run -it -p 8080:3000 -v "e:/dev/docker/ExpressSite:/var/www" -w "/var/www" node npm start
docker run -it -p 8080:3000 -v "E:/dev/docker/ExpressSite:/var/www" -w "/var/www" node npm start
- docker run -it -p 8080:3000 -v `pwd`:/var/www -w “/var/www” node npm start
docker run -p 8080:3000 -v C:\Users\sean\docker\ExpressSite:/var/www -w "/var/www" node npm start
docker run -p 8080:3000 -v "C:\Users\sean\docker\ExpressSite:/var/www" -w "/var/www" node npm start
npm info it worked if it ends with ok
npm info using npm@3.9.3
npm info using node@v6.2.1
npm ERR! Linux 4.4.12-moby
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.2.1
npm ERR! npm v3.9.3
npm ERR! path /var/www/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/www/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/var/www/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/www/npm-debug.log
So either the volume mounting is silently failing or I configured something incorrectly.
Update
Just read through this thread Volume mounts in windows does not work and it seems others are experiencing the same issues. I’ll keep an eye on any developments there.