Public | Automated Build

Last pushed: 3 months ago
Short Description
Postgres Utility tools
Full Description

Postgres Tools Docker image

Usage

Backup

docker run --rm \
 --link postgres_server:postgresserver \
 -v /path/to/backup/path:/data \
 -e POSTGRES_DB_USER=root \
 -e POSTGRES_DB_PASS=secret \
 -e POSTGRES_DB_NAME=mydatabase \
 -e DUMP_SUFFIX=production \
 -e DUMP_EXPLODED=true \
nouvellemarque/postgres-tools dump

  • postgres_server - the postgres docker container
  • /path/to/backup/path - the path on your host where the backup would be stored
  • DUMP_SUFFIX - suffix for each file
  • DUMP_EXPLODED - dump all tables into separate files

Restore

docker run --rm \
 --link postgres_server:postgresserver \
 -v /path/to/backup/path:/data \
 -e DUMP_FILE=dumpfile.tar.gz \
 -e POSTGRES_DB_USER=root \
 -e POSTGRES_DB_PASS=secret \
nouvellemarque/postgres-tools restore
  • postgres_server - the postgres docker container
  • SOURCE - the filename of the dump to restore
  • /path/to/backup/path - the path on your host where the backup is stored

Restore to target database

docker run --rm \
 --link postgres_server:postgresserver \
 -v /path/to/backup/path:/data \
 -e DUMP_FILE=dumpfile.tar.gz \
 -e DUMP_DB_TARGET=mynewdatabase \
 -e POSTGRES_DB_USER=root \
 -e POSTGRES_DB_PASS=secret \
nouvellemarque/postgres-tools restore
  • DUMP_DB_TARGET - the name of the database to restore
Docker Pull Command
Owner
nouvellemarque
Source Repository