docker-postgresql
docker-postgresql copied to clipboard
Create ~/.pgpass file
It would be helpful to create a /root/.pgpass file when DB_USER= DB_PASS are set in the run command, as the postgresql conf is set to md5 and peer, and the DB_USER may not exist as a user within the system.
As a side-note, I was thrown off between:
- /var/lib/postgresql/9.4/main/pg_hba.conf and
- /etc/postgresql/9.4/main/pg_hba.conf
Yes this would be really nice. It is the only way I found to be able to create database dumps from the host with docker exec ...
.
I don't fully understand this use case. Can you please provide some details.
As for now, the image has the PG_TRUST_LOCALNET
option which should allow you to login without a password. For backups a new replication mode us made available to backup the entire cluster https://github.com/sameersbn/docker-postgresql#creating-a-backup.
Please note: at the moment this backup feature is only available in the latest
tag.
docker exec -i container-id sudo -u postgres -- pg_dump "$@"
works great to me.