diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9ec6672..5784843 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -116,6 +116,7 @@ jobs: build-args: | CNPG_TAG=${{ matrix.cnpg }} PGVECTORS_TAG=${{ matrix.pgvectors }} + VECTORCHORD_TAG=${{ matrix.vectorchord }} results: if: ${{ always() }} diff --git a/Dockerfile b/Dockerfile index 432723a..ac52f28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,10 +9,19 @@ ARG TARGETARCH # drop to root to install packages USER root -ADD https://github.com/tensorchord/pgvecto.rs/releases/download/$PGVECTORS_TAG/vectors-pg${CNPG_TAG%.*}_${PGVECTORS_TAG#"v"}_$TARGETARCH.deb ./pgvectors.deb -RUN apt install ./pgvectors.deb -ADD https://github.com/tensorchord/VectorChord/releases/download/$VECTORCHORD_TAG/postgresql-${CNPG_TAG%.*}-vchord_${VECTORCHORD_TAG#"v"}-1_$TARGETARCH.deb ./vchord.deb -RUN apt-get install -y ./vchord.deb && rm -f ./vchord.deb +RUN apt update && apt install -y curl wget +# Extract PostgreSQL major version from CNPG_TAG (handles formats like "17.5-bookworm" -> "17") +RUN PG_MAJOR=$(echo $CNPG_TAG | cut -d'-' -f1 | cut -d'.' -f1) && \ + curl -L -o ./pgvectors.deb "https://github.com/tensorchord/pgvecto.rs/releases/download/$PGVECTORS_TAG/vectors-pg${PG_MAJOR}_${PGVECTORS_TAG#"v"}_$TARGETARCH.deb" && \ + apt install -y ./pgvectors.deb && \ + rm -f ./pgvectors.deb + +RUN PG_MAJOR=$(echo $CNPG_TAG | cut -d'-' -f1 | cut -d'.' -f1) && \ + curl -L -o ./vchord.deb "https://github.com/tensorchord/VectorChord/releases/download/$VECTORCHORD_TAG/postgresql-${PG_MAJOR}-vchord_${VECTORCHORD_TAG}-1_$TARGETARCH.deb" && \ + apt install -y ./vchord.deb && \ + rm -f ./vchord.deb + +# go back to postgres user USER postgres