# Lean alpine+pgvector build — postgres:16-alpine base with pgvector v0.8.0 compiled from source. # Build deps are installed and removed in the same RUN layer so they do not bloat the final image. ARG PG_MAJOR=16 FROM postgres:${PG_MAJOR}-alpine ARG PG_MAJOR ARG PGVECTOR_VERSION=v0.8.0 RUN apk add --no-cache --virtual .build-deps \ build-base \ clang15 \ llvm15 \ git \ postgresql${PG_MAJOR}-dev \ && git clone --branch ${PGVECTOR_VERSION} --depth 1 \ https://github.com/pgvector/pgvector.git /tmp/pgvector \ && cd /tmp/pgvector \ && make clean \ && make OPTFLAGS="" \ && make install \ && rm -rf /tmp/pgvector \ && apk del .build-deps