2023-12-16 18:52:42 +01:00
|
|
|
# syntax=docker/dockerfile-upstream:master
|
2023-11-27 10:55:19 +00:00
|
|
|
ARG CNPG_TAG
|
2023-11-26 14:24:06 +00:00
|
|
|
|
2023-12-16 18:52:42 +01:00
|
|
|
FROM ghcr.io/cloudnative-pg/postgresql:$CNPG_TAG
|
2023-11-26 14:24:06 +00:00
|
|
|
|
2023-11-27 11:56:23 +00:00
|
|
|
ARG CNPG_TAG
|
2023-11-27 10:48:15 +00:00
|
|
|
ARG PGVECTORS_TAG
|
2023-12-16 17:42:48 +01:00
|
|
|
ARG TARGETARCH
|
2023-11-27 11:54:30 +00:00
|
|
|
|
2023-11-26 16:51:11 +00:00
|
|
|
# drop to root to install packages
|
|
|
|
|
USER root
|
2023-12-16 18:52:42 +01:00
|
|
|
ADD https://github.com/tensorchord/pgvecto.rs/releases/download/$PGVECTORS_TAG/vectors-pg${CNPG_TAG%.*}_${PGVECTORS_TAG#"v"}_$TARGETARCH.deb ./pgvectors.deb
|
2023-11-26 16:51:11 +00:00
|
|
|
RUN apt install ./pgvectors.deb
|
2023-11-26 14:24:06 +00:00
|
|
|
|
2023-11-26 16:51:11 +00:00
|
|
|
USER postgres
|
2023-11-26 14:24:06 +00:00
|
|
|
|
2023-11-26 16:51:11 +00:00
|
|
|
# From https://stackoverflow.com/a/42508925
|
|
|
|
|
# Note that this way of enabling the plugin only works on database init
|
|
|
|
|
# We should investigate alternative ways of enabling it that will always work
|
2023-12-16 17:42:48 +01:00
|
|
|
COPY install-pgvectors.sql /docker-entrypoint-initdb.d/
|