I want to clarify the meaning of the "device" and "mountpoint" when I do the command
docker volume inspect
in Postgres container. I manually created test_postgresdb_vol_2 folder in /user/data/test_postgresdb_vol_2 to store persist the data from container, but now I'm confusing since I have two different paths. Can you clarify what is happening and what is the meaning of
"device" path and "mountpoint" path.
Example of volume inspect:
[
{
"CreatedAt": "...",
"Driver": "local",
"Labels": {
....
},
"Mountpoint": "/var/lib/docker/volumes/test_pgdata/_data",
"Name": "test_pgdata",
"Options": {
"device": "/user/data/test_postgresdb_vol_2",
"o": "bind",
"type": "none"
},
"Scope": "local"
}
]
Example of docker-compose:
postgres:
container_name: postgres
image: postgres
volumes:
- pgdata:/var/lib/postgresql/data
environment:
...
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
pgdata:
driver: local
driver_opts:
o: bind
type: none
device: /user/data/test_postgresdb_vol_2