pg_dump manual
Run within the database container pg_dump -U <user> <database_name> > dump.sql
pg_dump -U <user> <database_name> > dump.sql
psql manual
Create database and run psql -U <user> <database_name> < dump.sql
psql -U <user> <database_name> < dump.sql