Files
cloudnative-vectorchord-pgv…/Dockerfile

26 lines
792 B
Docker
Raw Normal View History

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-27 11:56:23 +00:00
ARG CNPG_TAG
2023-11-27 10:48:15 +00:00
ARG PGVECTORS_TAG
ARG TARGETARCH
2023-11-27 11:54:30 +00:00
WORKDIR /download
2023-11-27 11:56:23 +00:00
RUN pg_major=$(echo $CNPG_TAG | cut -d'.' -f1) \
&& curl --fail -o pgvectors.deb -sSL https://github.com/tensorchord/pgvecto.rs/releases/download/$PGVECTORS_TAG/vectors-pg${pg_major}_${PGVECTORS_TAG#"v"}_$TARGETARCH.deb
2023-11-27 11:54:30 +00:00
FROM ghcr.io/cloudnative-pg/postgresql:$CNPG_TAG
2023-11-26 14:24:06 +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
RUN apt install ./pgvectors.deb
2023-11-26 14:24:06 +00:00
USER postgres
2023-11-26 14:24:06 +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/