Custom PostgreSQL image with pre-installed extensions for search, geospatial, vector, and job scheduling.
| Version | Tags |
|---|---|
| 18 | 18, latest |
| 17 | 17 |
| 16 | 16 |
| Extension | Source | PG Versions | Notes |
|---|---|---|---|
| pg_search | ParadeDB image | 16, 17, 18 | BM25 full-text search (ParadeDB) |
| pg_ivm | ParadeDB image | 16, 17, 18 | Incremental view maintenance |
| pgvector | APT (latest) | 16, 17, 18 | Vector similarity search |
| PostGIS 3 | APT (latest) | 16, 17, 18 | Geospatial database (+ topology, geocoder) |
| pg_cron | APT (latest) | 16, 17, 18 | Job scheduler (postgres DB only) |
| pg_textsearch | GitHub release 0.5.0 | 17, 18 | BM25 ranked text search (Timescale); manual CREATE EXTENSION required — conflicts with pg_search |
| fuzzystrmatch | PostgreSQL contrib | 16, 17, 18 | Fuzzy string matching |
| pg_stat_statements | PostgreSQL contrib | 16, 17, 18 | Query performance statistics (preloaded) |
| Arg | Default | Description |
|---|---|---|
PG_VERSION_MAJOR | 17 | PostgreSQL major version |
PG_TEXTSEARCH_VERSION | 0.5.0 | pg_textsearch release version |
docker build --build-arg PG_VERSION_MAJOR=17 -t postgres:17 postgres/
Most extensions are auto-created in template1 and $POSTGRES_DB at first startup. pg_textsearch must be created manually (CREATE EXTENSION pg_textsearch;) because it conflicts with pg_search's BM25 access method.
docker run -d \
--name postgres \
-e POSTGRES_USER=myuser \
-e POSTGRES_PASSWORD=mypassword \
-e POSTGRES_DB=mydb \
-v pgdata:/var/lib/postgresql/data \
-p 5432:5432 \
postgres:17
These are inherited from the official postgres base image. This image does not add any custom environment variables.
| Variable | Default | Description |
|---|---|---|
POSTGRES_PASSWORD | (required) | Superuser password |
POSTGRES_USER | postgres | Superuser username |
POSTGRES_DB | value of POSTGRES_USER | Default database created at startup |
PGDATA | /var/lib/postgresql/data | Data directory inside the container |
| Path | Purpose |
|---|---|
/var/lib/postgresql/data | Database storage. Mount a named volume or bind mount to persist data. |
/docker-entrypoint-initdb.d/ | Initialization scripts that run once on first startup (see below). |
To run your own SQL or shell scripts when the database is first created, mount them into /docker-entrypoint-initdb.d/:
docker run -d \
-e POSTGRES_PASSWORD=mypassword \
-v pgdata:/var/lib/postgresql/data \
-v ./my-init-scripts:/docker-entrypoint-initdb.d/ \
postgres:17
Scripts are executed in alphabetical order. This image ships 001-create-paradedb-extensions.sh, which creates the bundled extensions. Use a higher numeric prefix (e.g. 100-my-setup.sql) so your scripts run after the extensions are ready.
Both .sql and .sh files are supported. These scripts only run on the first startup — when the data directory is empty. If you need to run migrations on an existing database, use psql or a migration tool instead.
To enable pg_textsearch (which conflicts with pg_search), create it manually in your init script:
-- 100-enable-textsearch.sql
CREATE EXTENSION IF NOT EXISTS pg_textsearch;
Content type
Image
Digest
sha256:211e87226…
Size
492.6 MB
Last updated
7 months ago
docker pull jeffh/postgres