Docker Community Forums

Share and learn in the Docker community.

Docker volume mapping not working


(Zackvynyl) #1

Hi I posted this issue at https://stackoverflow.com/questions/50805885/docker-volume-mapping-not-working to reproduce the issue, just download the zip https://repl.it/repls/BurlyAncientTrust.zip

Unzip it, cd into it and run:

(image=node-web-app && docker build -t $image . && docker run --rm -p 49160:8080 -d $image)

Visiting localhost:49160 works but for some reason I can’t get the -v option working for volume mapping:

(image=node-web-app && docker ps -a -q --filter=ancestor=$image | xargs docker rm -f && docker rmi $image)
(image=node-web-app && docker build -t $image . && docker run --rm -v "$(pwd)":/usr/src/app -p 49160:8080 -d $image)

I’m on Mac OS X High Sierra 10.13.4 (17E199). Could someone please download the zip and see if volume mapping works for them? I must be missing something fundamental.

Thanks!