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, and pgaudit. It is licensed under the PostgreSQL License. Like upstream, the image has one stream per PostgreSQL major, each built the way upstream's Dockerfile for that major builds it. Each stream has a tag with its major version number, and latest follows the newest major.
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. postgis_tiger_geocoder is not included either, because newer PostGIS releases moved it out of their source tree. 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/...".POSTGRES_INITDB_ARGS).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:
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. Older upstream 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 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. Where the image ships TimescaleDB, it 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.
A move to the tag of a newer major is a PostgreSQL major upgrade: the newer server cannot start on the older data directory, so upgrade the data with pg_upgrade, or dump the databases and restore them into a new container. Before pg_upgrade, do what upstream's own upgrade script does, in every database:
timescaledb and plv8 when the newer major does not have them, as on PostgreSQL 17 and later. DROP EXTENSION timescaledb fails while hypertables exist, and CASCADE deletes them with their data, so move that data out first.amcheck, pg_graphql, pg_stat_monitor, and plpgsql_check, and create them again after the upgrade. Their catalogs record versioned libraries of the older build. Do the same for address_standardizer and address_standardizer_data_us if an older PostGIS release, from before the split, created them.After the upgrade, run step 3 of the previous section on the new container. pgaudit updates from its older versions.
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.POSTGRES_INITDB_ARGS (PostgreSQL 17 and later): --allow-group-access --locale-provider=icu --encoding=UTF-8 --icu-locale=en_US.UTF-8, as upstream sets.Set POSTGRES_PASSWORD when you start the container. The other variables of the docker-library entrypoint also work; on PostgreSQL 17 and later, setting POSTGRES_INITDB_ARGS replaces the image's value.
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:
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