python-docker-tutorial icon indicating copy to clipboard operation
python-docker-tutorial copied to clipboard

docker: invalid reference format. $(pwd) in command: docker run --name fastapi-container -p 80:80 -d -v $(pwd):/code fastapi-image

Open pillomanWeb99 opened this issue 2 years ago • 0 comments

This is for someone who is experiencing a similar error on a Windows operating system.

I follow all the tutorial and for me (Machine with Windows 11 PRO, Docker desktop), the command:

docker run --name fastapi-container -p 80:80 -d -v $(pwd):/code fastapi-image

give me the next error:

docker: invalid reference format.

I change the command to

### docker run --name fastapi-container -p 80:80 -d -v ${pwd}:/code fastapi-image

And run ok

pillomanWeb99 avatar Aug 02 '23 20:08 pillomanWeb99