Home > database >  Why have I an error message "invalid reference format" when working with Docker?
Why have I an error message "invalid reference format" when working with Docker?

Time:09-22

I'm following the below tutorial and they use docker. I got an error When I tried to mount my local folder to the container. https://www.youtube.com/watch?v=bhBSlnQcq2k

docker run --name some-nginx -v $(pwd):/usr/share/nginx/html:ro -d -p 8080:80 nginx

I got the following error:

docker: invalid reference format.

I am using Windows 10 PowerShell, Visual Studio Code, and Nginx image. Any ideas are highly appreciated.

CodePudding user response:

with powershell you should use ${PWD} instead of $(pwd)

then you should do

docker run --name some-nginx -v ${PWD}:/usr/share/nginx/html:ro -d -p 8080:80 nginx

possible duplicate of : Mount current directory as a volume in Docker on Windows 10

  • Related