Skip to content

EnterpriseDB/docker-postgresql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostgreSQL Container Images by EnterpriseDB

Maintenance scripts to generate Immutable Application Containers for all available PostgreSQL versions (11 to 15) based on:

  • Red Hat Universal Base Images (UBI) 8 - default (with and without the PostGIS extension)
  • Debian Buster (10) Slim base images

UBI8 based images are available for amd64, arm64, ppc64le and s390x architectures. Debian 10 based images are available for amd64 and arm64 architectures.

Multilang images (-multilang) are container images enhanced with the full list of Locales. Available for all UBI based images.

These images are customised to work with EDB Postgres for Kubernetes by EDB for Kubernetes and Red Hat Openshift.

It is also possible to run them directly with Docker, for PostgreSQL evaluation and testing purposes only.

The images include:

  • PostgreSQL
  • Barman Cloud
  • PostGIS 3.1 (optional, on UBI based images only)
  • PGAudit
  • All language packs for glibc (optional, on UBI based images only)

PostgreSQL is distributed by the PGDG under the PostgreSQL License.

Barman Cloud is distributed by EnterpriseDB under the GNU GPL 3 License.

PostGIS is distributed under the GNU GPL 2 License.

PGAudit is distributed under the PostgreSQL License.

Images are available via GitHub Container Registry and Quay.io.

The Docker entry point is based on Docker Postgres distributed by the PostgreSQL Docker Community under MIT license.

How to pull the image

The image can be pulled with the docker pull command, following the instructions you find in the GitHub Container Registy (GHCR) or Quay.io.

For example you can pull the latest minor version of the latest major version of PostgreSQL based on RedHat UBI from GHCR with the following command:

docker pull ghcr.io/enterprisedb/postgresql

Note: replace ghcr.io with quay.io to download from Quay.io.

If you want to use the latest minor version of a particular major version of PostgreSQL, for example 15, on UBI you can type:

docker pull ghcr.io/enterprisedb/postgresql:15

In order to install the latest minor version of PostgreSQL 15 on a Debian based image, you can type:

docker pull ghcr.io/enterprisedb/postgresql:15-debian

IMPORTANT: in the examples below we assume that the latest minor of the latest major version is used.

How to use this image with Docker

Start a PostgreSQL instance in background

$ docker run -d \
   --name some-postgres \
   -e POSTGRES_PASSWORD=mysecretpassword \
   ghcr.io/enterprisedb/postgresql

The default postgres user and database are created in the entrypoint with initdb.

The postgres database is a default database meant for use by users, utilities and third party applications.

postgresql.org/docs

Disposable environment to run SQL commands via psql

You can spin up a disposable PostgreSQL database and run queries using the psql command line client utility with:

$ docker run -it --rm \
   --network some-network \
   ghcr.io/enterprisedb/postgresql \
   psql -h some-postgres -U postgres
psql (15.1)
Type "help" for help.

postgres=# SELECT 1;
 ?column?
----------
        1
(1 row)

Continuous Integration Continuous Delivery Automatic Updates