DEV Community

Discussion on: Learn Docker - from the beginning, part II volumes

Collapse
 
sygyzmundovych profile image
Vitaliy Rudnytskiy

Hi Chris. Thanks for the effort to write these nice tutorials. I'm not completely new to Docker, but still learned some new tricks :)

One additional suggestion is to call the command with volume option using " around $(pwd), like:
$ docker run -d -p 8000:3000 --name my-container --volume "$(PWD)":/app image-name

In my case the command from the tutorial was throwing an error

$ docker run -d -p 8000:3000 --name my-container --volume $(PWD):/app image-name
docker: invalid reference format.
See 'docker run --help'.

because the directory path had spaces in it. Do not ask me why, pls ;-)

Regards,
-Vitaliy

Collapse
 
softchris profile image
Chris Noring

oh wow.. Great tip Vitaly thanks.. I'll update the article :)