I need to use “pgvector” extension and I would like to use the bitnami’s postgres helm chart in order to have the advantages of the helm chart confgurations.
https://github.com/pgvector/pgvector
https://artifacthub.io/packages/helm/bitnami/postgresql/15.5.16
This answer is based on a proposal on github by user “coronabytes”:
https://github.com/bitnami/containers/issues/32677
- Create a multistage dockerfile let’s call it Dockerfile_pgvector
FROM pgvector/pgvector:pg16 AS builder
FROM bitnami/postgresql:16.3.0-debian-12-r19
COPY --from=builder /usr/lib/postgresql/16/lib/vector.so /opt/bitnami/postgresql/lib/
COPY --from=builder /usr/share/postgresql/16/extension/vector* /opt/bitnami/postgresql/share/extension/
- Build, tag and push your image to your registry
docker build -t registry.gitlab.com/my-company/project/bitnami/postgresql -f Dockerfile_pgvector .
docker push registry.gitlab.com/my-company/project/bitnami/postgresql
- Note that it is important that the image is called bitnami/postgresql
- Edit your bitnami helm chart’s values
postgresql:
architecture: standalone
image:
tag: latest
pullPolicy: Always
registry: registry.gitlab.com/my-company/project
pullSecrets:
- gitlab-registry-secret
- Note the registry stops at the project, the chart is configured to always search “bitnami/postgres” as image.