Skip to end of metadata
Go to start of metadata

This is how you can dump a database / schema to a SQL file from within a PostgreSQL Docker container to the local filesystem:

docker exec CONTAINERNAME sh -c 'exec pg_dump --blobs --username=DBUSERHERE DBNAME' > DBNAME.sql

For example, I'm creating a daily dump of my Atlassian Confluence instance like this:

docker exec r-aseith-wiki_db_1 sh -c 'exec pg_dump --blobs --username=confluence confluence' | gzip > confluence.sql.gz
Write a comment…