-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.postgres.templ
31 lines (25 loc) · 1.24 KB
/
Dockerfile.postgres.templ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM postgis/postgis:${POSTGIS_VERSION} AS builder
RUN set -x; \
apk update \
&& apk add \
git \
build-base \
clang \
llvm19-dev
ENV LLVM_CONFIG=/usr/bin/llvm-config-19
RUN set -x; \
cd /tmp \
&& find / | grep postgresql | grep -v "/tmp" > /tmp/pg_paths_before.txt \
&& git clone --depth 1 --branch v${PGVECTOR_VERSION} https://github.com/pgvector/pgvector.git \
&& cd pgvector \
&& make \
&& make install \
&& find / | grep postgresql | grep -v "/tmp" > /tmp/pg_paths_after.txt
FROM postgis/postgis:${POSTGIS_VERSION} AS final
COPY --from=builder /usr/local/lib/postgresql/bitcode/vector.index.bc /usr/local/lib/postgresql/bitcode/vector.index.bc
COPY --from=builder /usr/local/lib/postgresql/bitcode/vector /usr/local/lib/postgresql/bitcode/vector
COPY --from=builder /usr/local/lib/postgresql/vector.so /usr/local/lib/postgresql/vector.so
COPY --from=builder /usr/local/share/postgresql/extension/vector* /usr/local/share/postgresql/extension/
COPY --from=builder /usr/local/include/postgresql/server/extension/vector /usr/local/include/postgresql/server/extension/vector
LABEL org.opencontainers.image.postgis_version="$POSTGIS_VERSION"
LABEL org.opencontainers.image.pgvector_version="$PGVECTOR_VERSION"