Ilkin Mehdiyev
Ilkin Mehdiyev

Reputation: 107

I am getting "docker: invalid reference format." in my local machine

I am trying to run postgresql container in my local (Windows 10 machine). i am using this command :

docker run -d --name pg-docker --restart=always --publish 5432:5432 -e POSTGRES_PASSWORD=postgres -v C:\Program Files\Docker\Volumes\pg:/var/lib/postgresql/data postgres:alpine

but its returning "docker: invalid reference format." error.

(P.S. I have my postgresql image)

Upvotes: 0

Views: 988

Answers (1)

deceze
deceze

Reputation: 522085

-v C:\Program Files\Docker\Volumes\pg:/var/lib/postgresql/data is read as two separate arguments due to the space in "Program Files". So "Files\Docker\Volumes\pg:/var/lib/postgresql/data" is interpreted as the docker image name.

Escape the space with a \ or wrap the path in quotes.

Upvotes: 2

Related Questions