https://github.com/informaticsmatters/docker-postgres-dump-loader
https://github.com/informaticsmatters/docker-postgres-dump-loader
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/informaticsmatters/docker-postgres-dump-loader
- Owner: InformaticsMatters
- Created: 2020-08-06T11:43:06.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-11-26T12:58:25.000Z (7 months ago)
- Last Synced: 2025-11-29T03:24:42.843Z (7 months ago)
- Language: Dockerfile
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A PostgreSQL 'dump' loader image
A PostgreSQL v12.3 client image to simplify the loading of postgres *dumps*
taken from one database using [pg_dump] to a (Kubernetes-based) new database.
## Usage
Build the container with the database dumps in the `dumps` directory
(encrypted with zip). Then, when built and pushed the image can be run
as a Kubernetes Job using the simple Job template in the repo and psql
commands issued to load the data into the new DB.
$ docker build . -t informaticsmatters/postgres-loader:latest
$ docker push informaticsmatters/postgres-loader:latest
$ kubectl create -f job.yaml
From within the container you can then decrypt the dumps...
# unzip squonk-20200907.sql.zip
And then load into the im-infra database...
# cat squonk-20200907.sql | \
psql --set ON_ERROR_STOP=on --host=database --username= squonk
When done, delete the loader Job/Pod...
$ kubectl delete job/pg-loader -n im-infra
---
[pg_dump]: https://www.postgresql.org/docs/9.5/backup-dump.html