This repository provides build scripts for generating pgEdge Postgres container images supporting Postgres versions 16, 17 and 18.
Images are built from pgEdge Enterprise Postgres packages using a rockylinux9-ubi base image.
Images are published on the pgEdge Github Container Registry.
There are currently 2 supported image flavors: minimal
and standard
.
Package lists contained under packagelists
show the exact contents of each image version.
Minimal images contain Postgres, and the following extensions:
- Spock
- LOLOR
- Snowflake
Standard images are based on minimal images, and contain additional extension and tools.
- PGAudit
- PostGIS
- pgVector
- Patroni
- pgBackRest
- psycopg2
The default entry point for this image is based on the official Postgres image entrypoint. Documentation on supported entrypoint behavior is located in the docker-library/docs repo. Running the container as root is not currently supported.
In addition to the default entry point, Patroni (/usr/local/bin/patroni
) can also be used as an entrypoint in the standard image.
To run a single instance you can use this command:
docker run --name pgedge-postgres \
-e POSTGRES_PASSWORD=mypassword \
-e POSTGRES_USER=admin \
-e POSTGRES_DB=example_db \
-p 6432:5432 \
-d ghcr.io/pgedge/pgedge-postgres:17-spock5-standard
You can then log in using psql
with the following command:
docker exec -it pgedge-postgres psql -U admin example_db
This repository includes two Docker Compose examples you can try out:
-
- This example runs a single Postgres instance using the standard image and initializes extensions.
-
- This example runs two Postgres instances as pgEdge nodes (n1 / n2) with Spock logical replication pre-configured.
This image is compatible with Docker volumes and bind mounts. The configuration
for both is similar. Because Postgres requires the data directory to be owned
by the user running the database, the PGDATA
directory should be specified as
a subdirectory of the volume mount.
By default, this image uses the following approach for volume configuration:
/var/lib/pgsql
is the recommended volume mount point/var/lib/pgsql/<pg_major_version>/data
is the default Postgres data directory (PGDATA
)
An example Docker compose spec that shows this looks like this:
pgedge-postgres:
image: ghcr.io/pgedge/pgedge-postgres:17-spock5-standard
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER:-admin}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_DB:-example_db}
volumes:
- data:/var/lib/pgsql
volumes:
data:
- Every image will have an immutable tag,
<postgres major.minor>-spock<major.minor.patch>-<flavor>-<epoch>
, e.g.17.6-spock5.0.0-standard-1
- Mutable tags also exist for:
- The latest image for a given Postgres major.minor + spock major version,
pg<postgres major.minor>-spock<major>-<flavor>
, e.g.17.6-spock5-standard
- The latest image for a given Postgres major + spock major version,
pg<postgres major>-spock<major>-<flavor>
, e.g.17-spock5-standard
- The latest image for a given Postgres major.minor + spock major version,