Skip to content

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

@pillomanWeb99

Description

@pillomanWeb99

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions