Sign inSign up

fireport/postgresql-pgvector

By fireport

•Updated 3 days ago

Bitnami PostgreSQL 16 with pgvector 0.8.1, non-root and OpenShift-compatible

Image
Databases & storage
0

27

fireport/postgresql-pgvector repository overview

⁠postgresql-pgvector

Bitnami PostgreSQL 16 with the pgvector⁠ extension (v0.8.1) compiled in. It runs as a non-root user and works on OpenShift's default restricted-v2 SCC, which assigns an arbitrary UID with GID 0.

Unofficial build. This repository is not affiliated with or endorsed by Bitnami, Broadcom or the pgvector project.

⁠What is in the image

  • Base image: bitnamilegacy/postgresql:16.3.0-debian-12-r14
  • pgvector v0.8.1, built from source and installed into /opt/bitnami/postgresql
  • Group-0 ownership and group permissions on /opt/bitnami/postgresql, so a random UID can read and run it
  • Default user 1001, as in the Bitnami image

It replaces the usual workaround of compiling pgvector at pod start in a root init container, which a restricted SCC rejects.

Maintenance note. The base image comes from the bitnamilegacy repository, which holds older Bitnami images that are no longer updated. Plan for security updates yourself.

⁠Tags

TagPostgreSQLpgvector
16.3.0-pgvector-0.8.116.3.00.8.1

⁠Configuration

The image uses the standard Bitnami PostgreSQL variables:

VariableDescription
POSTGRESQL_USERNAMEApplication user to create
POSTGRESQL_PASSWORDPassword of that user
POSTGRESQL_DATABASEDatabase to create
POSTGRESQL_POSTGRES_PASSWORDPassword of the postgres admin user
POSTGRESQL_SHARED_PRELOAD_LIBRARIESOptional, for example pgaudit

The server listens on port 5432 and stores data under /bitnami/postgresql. As with every Bitnami PostgreSQL image, users and passwords are only applied when a new, empty data directory is initialised. An existing volume keeps the roles it already has.

⁠Run with Docker

docker run --rm -p 5432:5432 \
  -e POSTGRESQL_USERNAME=statgpt \
  -e POSTGRESQL_PASSWORD=<password> \
  -e POSTGRESQL_DATABASE=statgpt \
  -e POSTGRESQL_POSTGRES_PASSWORD=<admin-password> \
  -v pgdata:/bitnami/postgresql \
  fireport/postgresql-pgvector:16.3.0-pgvector-0.8.1

Enable the extension in each database that needs it:

CREATE EXTENSION IF NOT EXISTS vector;

⁠Use with the Bitnami PostgreSQL Helm chart

pgvector:
  image:
    registry: docker.io
    repository: fireport/postgresql-pgvector
    tag: 16.3.0-pgvector-0.8.1
  primary:
    podSecurityContext:
      enabled: false
    containerSecurityContext:
      enabled: false

Disabling the security contexts lets OpenShift assign the UID and GID. If the chart validates images, you may also need global.security.allowInsecureImages: true.

⁠Check the extension files with a random UID

docker run --rm --user 1000970000:0 --entrypoint sh \
  fireport/postgresql-pgvector:16.3.0-pgvector-0.8.1 \
  -c 'ls -l /opt/bitnami/postgresql/lib/vector.so /opt/bitnami/postgresql/share/extension/vector.control'

⁠Build it yourself

docker build --platform linux/amd64 \
  -f Dockerfile.postgresql-pgvector \
  -t fireport/postgresql-pgvector:16.3.0-pgvector-0.8.1 .

PGVECTOR_VERSION is a build argument, v0.8.1 by default.

Tag summary

Content type

Image

Digest

sha256:71f0598a9…

Size

272.5 MB

Last updated

3 days ago

docker pull fireport/postgresql-pgvector:16.3.0-pgvector-0.8.1