Very helpful article and thanks for taking time to put it together. I had a question about the last docker run command. Shouldn't that include an image name at the end? The version I see currently is:
docker run -d -p 8000:3000 --name my-container --volume $(PWD):/app
But, when I use that in my machine, I get "docker run" requires at least 1 argument. Only way I was able to fix it was by adding the image name at the end.
docker run -d -p 8000:3000 --name my-container --volume "%cd%":/app chrisnoring/node
NOTE: "%cd%" is being used instead of $(PWD) since it's a windows machine
also worth adding that if you are on windows using git bash the path conversion gets messy so that command substituition needs to be escaped like this:
~> docker run -d -p 8000:3000 --name EXAMPLE --volume /$(pwd)/logs:/logs YOUR_IMAGE
Very helpful article and thanks for taking time to put it together. I had a question about the last docker run command. Shouldn't that include an image name at the end? The version I see currently is:
But, when I use that in my machine, I get "docker run" requires at least 1 argument. Only way I was able to fix it was by adding the image name at the end.
NOTE:
"%cd%"
is being used instead of$(PWD)
since it's a windows machineHey. You are completely right. Sorry, you had to lose time over this and thank you for posting this correction, I've updated the article.
also worth adding that if you are on windows using git bash the path conversion gets messy so that command substituition needs to be escaped like this:
~> docker run -d -p 8000:3000 --name EXAMPLE --volume /$(pwd)/logs:/logs YOUR_IMAGE
For me (in windows git bash), I also had to wrap around with
""
to make it work.$ docker run -d -p 8000:3000 --name YOU_NAME --volume /"$(pwd)"/logs:/logs YOUR_IMAGE