I created a PostgreSQL database in Docker container and tried to create a local folder and mount it as a data volume for our running container to store all the database files in a known location as shown below:
docker run -d `
--name postgres-dev `
-e POSTGRES_PASSWORD=<my_password> `
-v //D/dev/docker/postgresql/data/:/var/lib/postgresql/data `
-p 5432:5432 -d postgres
ALthough I created the image and connect it via pgAdmin without any problem, there is no file on D:\dev\docker\postgresql\data location even after creating a table and inserting data into it.
I want to use my local Windows folder D:\dev\docker\postgresql\data as data volume, but I am not sure if I converted the following line of the example that I followed correctly:
from -v ${HOME}/postgres-data/:/var/lib/postgresql/data
to -v //D/dev/docker/postgresql/data/:/var/lib/postgresql/data
I think the example is for Linux, but I have no idea what is the first and second parts before and after ":" Could you please clarify me about these parts and how I should use it properly to use my local Windows folder D:\dev\docker\postgresql\data as data volume?
${HOME}/postgres-data/location would be also useful.docker run -d --name postgres-dev -e POSTGRES_PASSWORD=password -v /home/tink/D/dev/docker/postgresql/data/:/var/lib/postgresql/data -p 5433:5433 -d postgres... had to choose different ports because I run postgres natively.