0

I am learning Docker and for a start I am setting up a Postgres-db with docker-compose. It is actually working but I can not find, where the persistent data is stored on Windows by default. This is my .yml.

#docker-compose.yml
version: "3.6"

services:
  mytestdb:
    image: postgres:10
    restart: always
    container_name: mytestdb
    environment:
      POSTGRES_PASSWORD: mytestdb
    ports:
      - 5433:5432
    volumes:
      - mytestdb_persistent_testdata:/var/lib/postgresql/data

volumes:
  mytestdb_persistent_testdata:

I was checking C://ProgramData/DockerDesktop as well as C://user/me/.docker. Are they named differently.

I'd appreciate a hint.

1 Answer 1

1

That's a bit depending on the setup of you docker installation. The common way was a separate virtual machine running your docker engine. The paths you see are paths inside that virtual machine and not directly accessible from windows (besides looking up the virtual machine disk image). If you are using the WSL2 mode, there is a way to access them easily from windows.

Please find all details in the answers to this other question, depending on how you are running your Docker for Windows.

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

1 Comment

Thanks, together with "docker volume ls" and related "docker volume ..."-commands it helped me a lot understanding better.

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.