packaged by Chainguard
Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.
Unmodified Postgres with some useful extensions
Chainguard Containers are regularly-updated, secure-by-default container images.
For those with access, this container image is available on cgr.dev:
Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.
Supabase Postgres is unmodified PostgreSQL bundled with the extensions and configuration that the Supabase platform relies on, such as supautils, pgsodium, Supabase Vault, pg_cron, pg_net, pgaudit, and TimescaleDB. It is licensed under the PostgreSQL License. This image follows the upstream PostgreSQL 15 stream (Dockerfile-15).
Chainguard's supabase-postgres image is comparable to the upstream supabase/postgres image on Docker Hub, with these differences:
PATH under /usr/bin, so the upstream Nix PATH entry, LOCALE_ARCHIVE, and GRN_PLUGINS_DIR are not set.pg_jsonschema, wrappers, plv8, pgroonga, pgrouting, and postgis_sfcgal. The WAL-G binary is not included either. A database that has one of these extensions installed fails when it uses it, with could not access file "$libdir/...".postgresql-15 package, so its minor version can be newer than the one in the tag. postgres --version shows it./var/run/postgresql and /tmp Unix sockets.gosu instead of su-exec.HEALTHCHECK and no EXPOSE entry. Publish port 5432 with -p, and add a health check where you run the container, such as the upstream pg_isready -U postgres -h localhost.The image keeps the upstream entrypoint (docker-entrypoint.sh), command (postgres -D /etc/postgresql), stop signal (SIGINT), and the Supabase configuration files under /etc/postgresql and /etc/postgresql-custom. Supabase's schema migrations in /docker-entrypoint-initdb.d run the first time the container initializes an empty data directory.
Like upstream, the container starts as root. The entrypoint fixes the ownership of the data directory and then runs PostgreSQL as the postgres user (UID 100, GID 101).
The pgsodium and Supabase Vault root key is generated on first start and written to /etc/postgresql-custom/pgsodium_root.key. Vault secrets can only be decrypted with that key, so keep /etc/postgresql-custom on a volume next to the data directory, as Supabase's own Docker Compose file and Helm chart do. A container without that volume loses the key, and every Vault secret, when it is recreated.
Both volumes must be writable by UID 100 and GID 101. The entrypoint changes the ownership of the data directory itself. A new, empty Docker volume at /etc/postgresql-custom gets the image's files and ownership.
Start a database with persistent data and configuration volumes. POSTGRES_PASSWORD sets the password of the supabase_admin superuser:
Wait for the server to finish initializing, then connect:
List the installed and available extensions:
The community Supabase chart deploys this image as its db component, and keeps /etc/postgresql-custom on its pgsodium volume. Its image.db values select the database image.
Add the chart repository:
Create a values file that points the db component at the Chainguard image:
Install the chart with the values file:
The chart's default database image is a PostgreSQL 17 build of supabase/postgres. This image is PostgreSQL 15, so use it for new releases, or for releases whose database already runs a 15.x image. A PostgreSQL 15 server cannot start on a data volume that PostgreSQL 17 initialized.
If you pull from a private Chainguard registry, create an image pull secret in the namespace and reference it with image.db.pullSecrets in values.yaml. Refer to the chart's values.yaml for the database password and other settings.
You can start this image on data and configuration volumes that the upstream image created. Stop the upstream container first, and back up both volumes.
Before the first start, add the configuration files the volume lacks, replace its extension scripts with this image's, and give it to UID 100. Upstream 15.8.x images have no conf.d directory, which the current postgresql.conf includes, and ran PostgreSQL as UID 105. The scripts in extension-custom-scripts run when an extension is created, and this image's copies carry its compatibility fixes, such as for postgis_tiger_geocoder and pgmq. Other existing files, including pgsodium_root.key, are kept:
Start the container with both volumes, as in Getting Started.
Bring every database up to this image. This image ships only the current TimescaleDB library, so in a database that has TimescaleDB, other queries fail until ALTER EXTENSION timescaledb UPDATE has run as the first command of a session. Other extensions are also behind this image's versions, and this image's glibc is newer than upstream's, which changes collation versions. Run this from the host for the supabase-db container:
For each database, it updates TimescaleDB first, then every other extension that is behind, rebuilds the indexes and records the new collation versions, and updates PostGIS with postgis_extensions_upgrade(). The script stops at the first command that fails, so a database whose indexes did not rebuild keeps its old collation versions and its collation warnings. Fix the cause and run the script again.
Databases that use an extension that this image does not include yet keep failing on that extension.
The image sets these environment variables, matching upstream:
PGDATA: The data directory, /var/lib/postgresql/data.POSTGRES_USER: The superuser created at initialization, supabase_admin.POSTGRES_DB: The default database, postgres.POSTGRES_HOST: The Unix socket directory the migrations connect through, /var/run/postgresql.LANG, LANGUAGE, LC_ALL: en_US.UTF-8.PATH: Starts with /usr/lib/postgresql/bin, which holds pgsodium_getkey.sh.Set POSTGRES_PASSWORD when you start the container. The other variables of the docker-library entrypoint, such as POSTGRES_INITDB_ARGS, also work.
The server reads /etc/postgresql/postgresql.conf, which includes the files in /etc/postgresql-custom/conf.d. To change a setting, add a .conf file to that directory on your configuration volume and restart the container.
Chainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.
All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system designed to produce container images that meet the requirements of a more secure software supply chain.
The main features of Chainguard Containers include:
For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a development, or -dev, variant.
In all other cases, including Chainguard Containers tagged as :latest or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.
Although the -dev container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev variant into a more minimal production image.
To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl, or API.
To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.
Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.
This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.
Chainguard's container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:
BSD-2-Clause
BSD-3-Clause
GPL-3.0-or-later
LGPL-2.1
MIT
Qhull
Unicode-TOU
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreementChainguard Containers are SLSA Level 3 compliant with detailed metadata and documentation about how it was built. We generate build provenance and a Software Bill of Materials (SBOM) for each release, with complete visibility into the software supply chain.
SLSA compliance at ChainguardThis image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.
PCI DSS at Chainguard