You can extend an EDB Hybrid Manager (HM) operand image with additional PostgreSQL extensions by building a custom container image and registering it with your HM deployment. This allows you to provision clusters with extensions not included in the standard EDB operand images.
Custom images are the customer's responsibility
EDB doesn't provide support coverage for custom-built operand images or extensions not officially delivered by EDB. You are responsible for maintaining, updating, and supporting any custom images you build.
Prerequisites
edbctl(the Hybrid Manager CLI) version 1.1.8 or later.- Docker CLI with
buildxversion 0.16.0 or later. - An EDB subscription token for accessing EDB package repositories.
- A container registry configured for image discovery in your HM deployment. See Configuring image discovery.
Setting up Docker buildx
Verify your
docker buildxversion is 0.16.0 or later:docker buildx versionCreate and activate a builder using the
docker-containerdriver:docker buildx create \ --name docker-container \ --driver docker-container \ --use \ --bootstrap
Setting environment variables
Export your EDB subscription token. This is used to authenticate with EDB package repositories during the image build:
export EDB_SUBSCRIPTION_TOKEN=<your-edb-subscription-token>
Set the target image variables.
TARGET_REGISTRYmust be the registry configured for image discovery in your HM deployment:export TARGET_REGISTRY="<your-registry>" # e.g. myregistry.azurecr.io export PG_FLAVOR="epas" # epas or pg export PG_MAJOR="18" # major version of the base image export TARGET_IMAGE="$TARGET_REGISTRY/edb-postgres-advanced-custom:18.3-<build-tag>"
Creating the Dockerfile
Create a Dockerfile that uses an EDB operand image as the base and installs your extension using dnf (EDB operand images use a UBI base).
The following example adds the edb_cloneschema extension to an EPAS 18 operand image. Replace the base image tag and package name with the values for your target extension and Postgres version:
FROM docker.enterprisedb.com/pgai-platform/edb-postgres-advanced:18.3-2605132051 USER root # Mount the EDB subscription token secret, configure the enterprise repository, and install the extension RUN \ set -eux -o pipefail ; \ curl -u token:$(cat /run/secrets/edb_token) -1sLf "https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh" | bash ; \ dnf -y install edb-as18-server-cloneschema ; \ rm -f /etc/yum.repos.d/enterprisedb-*.repo # Switch back to the standard non-root Postgres execution user inside HCP operands USER 26
Note the following:
- The base image must be an EDB operand image from
docker.enterprisedb.com/pgai-platform/. - The EDB subscription token is injected as a build secret and is never stored in the image layers.
- The enterprise repository is removed after installation to keep the image clean.
- The image must end with
USER 26, the non-root Postgres execution user required by HM operands.
Building and pushing the image
Build and push the image to your target registry:
docker buildx build --push \ --platform=linux/amd64 \ -t $TARGET_IMAGE \ --annotation "index,manifest:org.enterprisedb.pg.flavor=${PG_FLAVOR}" \ --annotation "index,manifest:org.enterprisedb.pg.major_version=${PG_MAJOR}" \ --annotation "index,manifest:org.enterprisedb.pg.features=psr,pgd,analytics,tde" \ --annotation "index,manifest:org.opencontainers.image.created=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \ --secret="id=edb_token,env=EDB_SUBSCRIPTION_TOKEN" .
Note
The org.enterprisedb.pg.features annotation controls which HM features are available for clusters provisioned with this image. Match the feature list to the capabilities of the source operand image you built from.
Note
For the complete flag reference for annotate-extensions, show-extensions, copy-version, and read-version, see edbctl operand.
Adding HM metadata
After pushing, you must add two sets of metadata to the image for it to work correctly in HM.
Annotating extensions
Scan the image and add extension metadata:
edbctl operand annotate-extensions $TARGET_IMAGEVerify the annotations were applied: