Custom PostgreSQL image based on the official image with additional embedded extensions, configuration and tools for learning and testing purposes.
- PostgreSQL 17.x
- PostgreSQL 16.x
- PostgreSQL 15.x
- PostgreSQL 14.x
This image embeds the following additional extensions:
- pgaudit
- pg_cron
- pg_repack
- pg_partman
- pg_qualstats
- pgvector
- pg_stat_kcache
- pg_stat_statements - loaded by default
- pg_prewarm - loaded by default
This image also embeds some famous PostgreSQL tools:
Since this image is based on the official image from the Docker Hub, therefore it inherits the available configuration parameters (such environment variables and initialization scripts).
At build time, a drop-in folder located at /etc/postgresql/config.d
is created to push some PostgreSQL configuration overrides. This allows to push partial PostgreSQL configuration chunks without having to rewrite a complete postgresql.conf
file if you just want to play with some configuration parameters.
First, create your configuration override:
# custom.conf
# I want mooaar cache !
shared_buffers = 2GB
# Let's activate WAL archiving
archive_mode = on
archive_command = '/path/to/my/custom archiving script'
Then, you can now run PostgreSQL with this custom configuration override (e.g using Docker):
$ docker run [options] -v $PWD/custom.conf:/etc/postgresql/config.d/custom.conf:ro ghcr.io/f-bn/postgresql:16.2
$ docker exec -ti <name> bash
$ su - postgres -c "psql -c 'SHOW shared_buffers'"
shared_buffers
----------------
2GB
More informations about PostgreSQL configuration here.