Couple useful docker commands

Posted: 8


//postgres
 // run shell in new postgres container
docker run -it --rm postgres bash
// run posgres-cli in new postgres container
docker run -e "PGPASSWORD=password" -it --rm postgres psql -h host.rds.amazonaws.com -U postgres
 // make db gz
docker run -e "PGPASSWORD=password" -it --rm postgres pg_dump -h shost.rds.amazonaws.com -U postgres -c | gzip > postgres.sql.gz
 // importdb dump to remote db
docker run -e "PGPASSWORD=password" -v localpath:/mnt -it --rm postgres psql -h host.rds.amazonaws.com -p 5432 -U dbuser -d dbname -f mnt/test.sql

If you find the post helpful you can share it


Ваше мнение:

Имя
   other with Docker
drcreazy © 2008-2012 all rights reserved