Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG BASE_TAG
ARG PGVECTOR_VERSION=0.8.1
FROM docker.io/postgres:${BASE_TAG}
ENTRYPOINT [ "/autoconf-entrypoint" ]
CMD []
Expand All @@ -19,12 +20,18 @@ ENV CERTS="{}" \
HBA_EXTRA_RULES=""
RUN apk add --no-cache python3 py3-netifaces \
&& if [ "${PG_MAJOR:-0}" -ge 12 ]; then \
apk add --no-cache postgresql-pgvector; \
cp /usr/share/postgresql/extension/vector* /usr/local/share/postgresql/extension/; \
cp /usr/lib/postgresql17/vector.so /usr/local/lib/postgresql/; \
apk add --no-cache --virtual .pgvector-build build-base linux-headers ca-certificates; \
wget -qO- "https://github.com/pgvector/pgvector/archive/refs/tags/v${PGVECTOR_VERSION}.tar.gz" \
| tar -xz -C /tmp; \
cd "/tmp/pgvector-${PGVECTOR_VERSION}" \
&& make PG_CONFIG=/usr/local/bin/pg_config \
&& make install PG_CONFIG=/usr/local/bin/pg_config; \
cd / && rm -rf "/tmp/pgvector-${PGVECTOR_VERSION}"; \
apk del .pgvector-build; \
fi \
&& mkdir -p /etc/postgres \
&& chmod a=rwx /etc/postgres

COPY autoconf-entrypoint /

# Metadata
Expand Down
Loading