2023-11-27 10:55:19 +00:00
|
|
|
ARG CNPG_TAG
|
2023-11-26 14:24:06 +00:00
|
|
|
|
2023-11-27 11:54:30 +00:00
|
|
|
FROM curlimages/curl AS download
|
2023-11-26 14:24:06 +00:00
|
|
|
|
2023-11-26 16:51:11 +00:00
|
|
|
ARG PG_MAJOR
|
2023-11-27 10:48:15 +00:00
|
|
|
ARG PGVECTORS_TAG
|
2023-11-27 11:54:30 +00:00
|
|
|
|
|
|
|
|
WORKDIR /download
|
|
|
|
|
RUN curl -o pgvectors.deb -sSL https://github.com/tensorchord/pgvecto.rs/releases/download/$PGVECTORS_TAG/vectors-pg$PG_MAJOR-$PGVECTORS_TAG-$(uname -m)-unknown-linux-gnu.deb
|
|
|
|
|
|
|
|
|
|
FROM ghcr.io/cloudnative-pg/postgresql:$CNPG_TAG
|
2023-11-26 14:24:06 +00:00
|
|
|
|
2023-11-26 16:51:11 +00:00
|
|
|
# drop to root to install packages
|
|
|
|
|
USER root
|
2023-11-27 11:54:30 +00:00
|
|
|
COPY --from=download /download/pgvectors.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
|
|
|
|
|
COPY install-pgvectors.sql /docker-entrypoint-initdb.d/
|