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.

AndreasInfo
  • 1,062
  • 11
  • 26

1 Answers1

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.

Andreas Jägle
  • 11,632
  • 3
  • 31
  • 31
  • Thanks, together with "docker volume ls" and related "docker volume ..."-commands it helped me a lot understanding better. – AndreasInfo Nov 19 '20 at 18:18