I would like to have a way to enter into the Postgresql container and get a data dump from it.
To run the container that has the Postgres user and password, you need to have preconfigured variables as container environment variable. For example:
docker run -it --rm --link : -e POSTGRES_PASSWORD= postgres /usr/bin/pg_dump -h -d -U > dump.sql