Sign inSign up

plavchub/postgres

By plavchub

•Updated over 6 years ago

Image
0

1.2K

plavchub/postgres repository overview

⁠plavchub/postgres

https://hub.docker.com/r/plavchub/postgres⁠

A postgres image based on official⁠ image with additional support for patching and backup.

⁠Supported tags

⁠How to use image

⁠Basic usage

docker run --name postgres -e POSTGRES_PASSWORD=mysecretpassword -d plavchub/postgres

⁠Additional features
⁠Patch scripts

Patching is supported by following similar approach as in official image with initial scripts.

Patches can be applied by adding .sql, .sql.gz or .sh scripts under /docker-entrypoint-patches.d. Scripts are executed upon container start when a database was already initialized (first run of a container).

For each successfully applied patch a new file is created with the same name as the patch script and suffix .applied.

For how to prepare patch scripts see official⁠ instructions for preparing initial scripts. The same rules are applied.

⁠Backup and restore

Docker image supports creating backups of the whole data folder PG_DATA. Backup can be created by running container with command backup. Backup files are stored in /backup folder. It is recommended to create backups on a stopped containers or data loss my occur.

In the same manner database can be restored. Backup files for restoring database must be in folder /backup.

Example of executing backup

docker run --name postgres plavchub/postgres backup

Example of executing restore

docker run --name postgres plavchub/postgres restore backup-2020-02-08-100000.tar.gz

Tag summary

Content type

Image

Digest

Size

109.1 MB

Last updated

over 6 years ago

docker pull plavchub/postgres