Skip to content

Commit

Permalink
Exclude pgai from 32bit ARM (#257)
Browse files Browse the repository at this point in the history
Exclude pgai from 32bit arm
  • Loading branch information
jgpruitt authored Jun 14, 2024
1 parent 0251f76 commit c4c44d0
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,6 @@ ARG OSS_ONLY

LABEL maintainer="Timescale https://www.timescale.com"

# install pgai only on pg16+
ARG PGAI_VERSION
ARG PG_MAJOR_VERSION
RUN set -ex; \
if [ "$PG_MAJOR_VERSION" -gt 15 ]; then \
apk update; \
apk add --no-cache --virtual .pgai-deps \
git \
cargo \
python3-dev \
py3-pip; \
git clone --branch ${PGAI_VERSION} https://github.com/timescale/pgai.git /build/pgai; \
cp /build/pgai/ai--*.sql /usr/local/share/postgresql/extension/; \
cp /build/pgai/ai.control /usr/local/share/postgresql/extension/; \
pip install --verbose --break-system-packages -r /build/pgai/requirements.txt; \
apk del .pgai-deps; \
fi

ARG PG_VERSION
RUN set -ex; \
Expand All @@ -72,6 +55,25 @@ RUN set -ex; \
make install; \
apk del .vector-deps

# install pgai only on pg16+ and not on arm
ARG PGAI_VERSION
ARG PG_MAJOR_VERSION
ARG TARGETARCH
RUN set -ex; \
if [ "$PG_MAJOR_VERSION" -gt 15 && "$TARGETARCH" != "arm" ]; then \
apk update; \
apk add --no-cache --virtual .pgai-deps \
git \
build-base \
cargo \
python3-dev \
py3-pip; \
git clone --branch ${PGAI_VERSION} https://github.com/timescale/pgai.git /build/pgai; \
cp /build/pgai/ai--*.sql /usr/local/share/postgresql/extension/; \
cp /build/pgai/ai.control /usr/local/share/postgresql/extension/; \
pip install --verbose --break-system-packages -r /build/pgai/requirements.txt; \
apk del .pgai-deps; \
fi

COPY docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d/
COPY --from=tools /go/bin/* /usr/local/bin/
Expand Down

0 comments on commit c4c44d0

Please sign in to comment.