File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,13 +26,18 @@ WORKDIR /usr/ports/databases/pgvector
2626RUN make DEFAULT_VERSIONS+=pgsql=${PG_VERSION} BATCH=yes install clean
2727
2828# Build VectorChord from source
29- ARG VECTORCHORD_VERSION=0.4.3
30- RUN fetch -qo /tmp/vectorchord.tar.gz \
29+ ARG VECTORCHORD_VERSION=latest
30+ RUN if [ "${VECTORCHORD_VERSION}" = "latest" ]; then \
31+ VECTORCHORD_VERSION=$(fetch -qo - https://api.github.com/repos/tensorchord/VectorChord/releases/latest | grep -o '"tag_name":"[^"]*"' | head -1 | cut -d'"' -f4); \
32+ fi && \
33+ echo "Building VectorChord ${VECTORCHORD_VERSION}..." && \
34+ fetch -qo /tmp/vectorchord.tar.gz \
3135 "https://github.com/tensorchord/VectorChord/archive/refs/tags/${VECTORCHORD_VERSION}.tar.gz" && \
3236 tar -xzf /tmp/vectorchord.tar.gz -C /tmp && \
3337 cd /tmp/VectorChord-${VECTORCHORD_VERSION} && \
3438 gmake build && \
35- gmake install
39+ gmake install && \
40+ mkdir -p /app && echo "${VECTORCHORD_VERSION}" > /app/vectorchord-version
3641
3742# Production image
3843FROM ghcr.io/daemonless/postgres:${PG_VERSION}
@@ -69,10 +74,6 @@ COPY --from=builder /usr/local/share/postgresql/extension/vchord* /usr/local/sha
6974RUN chmod 644 /usr/local/share/postgresql/extension/vchord* && \
7075 chmod 755 /usr/local/lib/postgresql/vchord.so
7176
72- # Extract version
73- RUN mkdir -p /app && \
74- pkg query '%v' postgresql${PG_VERSION}-server | sed 's/_.*$//' > /app/version
75-
7677# Copy init scripts for extensions
7778COPY docker-entrypoint-initdb.d/ /docker-entrypoint-initdb.d/
7879RUN chmod 644 /docker-entrypoint-initdb.d/*
Original file line number Diff line number Diff line change @@ -26,13 +26,18 @@ WORKDIR /usr/ports/databases/pgvector
2626RUN make DEFAULT_VERSIONS+=pgsql=${PG_VERSION} BATCH=yes install clean
2727
2828# Build VectorChord from source
29- ARG VECTORCHORD_VERSION=0.4.3
30- RUN fetch -qo /tmp/vectorchord.tar.gz \
29+ ARG VECTORCHORD_VERSION=latest
30+ RUN if [ "${VECTORCHORD_VERSION}" = "latest" ]; then \
31+ VECTORCHORD_VERSION=$(fetch -qo - https://api.github.com/repos/tensorchord/VectorChord/releases/latest | grep -o '"tag_name":"[^"]*"' | head -1 | cut -d'"' -f4); \
32+ fi && \
33+ echo "Building VectorChord ${VECTORCHORD_VERSION}..." && \
34+ fetch -qo /tmp/vectorchord.tar.gz \
3135 "https://github.com/tensorchord/VectorChord/archive/refs/tags/${VECTORCHORD_VERSION}.tar.gz" && \
3236 tar -xzf /tmp/vectorchord.tar.gz -C /tmp && \
3337 cd /tmp/VectorChord-${VECTORCHORD_VERSION} && \
3438 gmake build && \
35- gmake install
39+ gmake install && \
40+ mkdir -p /app && echo "${VECTORCHORD_VERSION}" > /app/vectorchord-version
3641
3742# Production image
3843FROM ghcr.io/daemonless/postgres:${PG_VERSION}
You can’t perform that action at this time.
0 commit comments