0

I am trying to run Postgresql in Docker using this code in a terminal:

`winpty docker run -it \
-e POSTGRES_USER="root" \
-e POSTGRES_PASSWORD="root" \
-e POSTGRES_DB="ny_taxi" \
-v C:\Users\SomeUser\OneDrive\Documents\ny_taxi_postgres_data:/var/lib/postgresql/data \
-p 5432:5432 \
postgres:13`

and I keep running into this error: Error response from daemon: The system cannot find the file specified.

I have looked up this error and the solutions I see online (such as restarting Docker Desktop, reinstalling Docker, updating Docker) did not work for me.

I think the issue is with the volume part (designated by -v) because when I remove it, it works just fine. However, I want to be able to store the contents in a volume permanently, so running it without the -v is not a long-term solution.

Has anyone run into a similar issue before?

1 Answer 1

1
  • Check if you can access to this path in host.

dir C:\Users\SomeUser\OneDrive\Documents\ny_taxi_postgres_data

  • check if you can access on volume inside a container.

winpty docker run -v C:\Users\SomeUser\OneDrive\Documents\ny_taxi_postgres_data:/data alpine ls /data

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much! I had been using MinGW64 as a terminal to connect to these folders, however, connecting to the directory there did NOT work. However, it did work on Command Prompt, which lead me to run the code on there instead, and finally I was able to get it to run. I am not sure what the issue is, but for now, it seems solved. Thanks for your help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.