Skip to content

Commit

Permalink
Install pgai dependencies first (#255)
Browse files Browse the repository at this point in the history
* Include python3-dev for building dependencies

* Install pgai dependencies first

---------

Signed-off-by: John Pruitt <jgpruitt@gmail.com>
  • Loading branch information
jgpruitt authored Jun 13, 2024
1 parent 8048dc8 commit 5410025
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ ARG OSS_ONLY

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

# install pgai only on pg16+
ARG PGAI_VERSION
RUN set -ex; \
if [ "$PG_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; \
apk update; \
Expand All @@ -54,23 +71,6 @@ RUN set -ex; \
make install; \
apk del .vector-deps

# install pgai only on pg16+
ARG PGAI_VERSION
RUN set -ex; \
if [ "$PG_VERSION" -gt 15 ]; 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 --no-cache-dir --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 5410025

Please sign in to comment.