Enable multiarch build

This commit is contained in:
bo0tzz
2023-11-27 11:54:30 +00:00
parent 1a09062dd9
commit 76388a6c0b
2 changed files with 8 additions and 5 deletions

View File

@@ -78,8 +78,7 @@ jobs:
uses: docker/build-push-action@v4.1.1
with:
context: .
# TODO: Enable multiarch build
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: ${{ !github.event.pull_request }}
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -1,14 +1,18 @@
ARG CNPG_TAG
FROM ghcr.io/cloudnative-pg/postgresql:$CNPG_TAG
FROM curlimages/curl AS download
ARG PG_MAJOR
ARG PGVECTORS_TAG
ARG ARCH=x86_64
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
# drop to root to install packages
USER root
ADD https://github.com/tensorchord/pgvecto.rs/releases/download/$PGVECTORS_TAG/vectors-pg$PG_MAJOR-$PGVECTORS_TAG-$ARCH-unknown-linux-gnu.deb ./pgvectors.deb
COPY --from=download /download/pgvectors.deb ./pgvectors.deb
RUN apt install ./pgvectors.deb
USER postgres