diff --git a/Containerfile.pkg b/Containerfile.pkg index 2843390..7e5a994 100644 --- a/Containerfile.pkg +++ b/Containerfile.pkg @@ -59,7 +59,8 @@ LABEL org.opencontainers.image.title="PostgreSQL ${PG_VERSION}" \ # Install PostgreSQL (and prebuilt pgvector when available) COPY --from=builder /out /tmp/pgvector-out -RUN pkg update && \ +RUN pkg-slim enable && \ + pkg update && \ pkg install -y ${PACKAGES} && \ if ls /tmp/pgvector-out/postgresql${PG_VERSION}-pgvector-* >/dev/null 2>&1; then \ pkg add /tmp/pgvector-out/postgresql${PG_VERSION}-pgvector-*; \ diff --git a/Containerfile.pkg.j2 b/Containerfile.pkg.j2 index a12ff6b..e975d10 100644 --- a/Containerfile.pkg.j2 +++ b/Containerfile.pkg.j2 @@ -60,7 +60,8 @@ LABEL org.opencontainers.image.title="{{ title }} ${PG_VERSION}" \ # Install PostgreSQL (and prebuilt pgvector when available) COPY --from=builder /out /tmp/pgvector-out -RUN pkg update && \ +RUN pkg-slim enable && \ + pkg update && \ pkg install -y ${PACKAGES} && \ if ls /tmp/pgvector-out/postgresql${PG_VERSION}-pgvector-* >/dev/null 2>&1; then \ pkg add /tmp/pgvector-out/postgresql${PG_VERSION}-pgvector-*; \ diff --git a/compose.yaml b/compose.yaml index 6fd9ac5..159dc9d 100644 --- a/compose.yaml +++ b/compose.yaml @@ -32,6 +32,20 @@ x-daemonless: `*.sql.gz`. They run as `bsd`, not as root, and connect as `POSTGRES_USER`, the superuser that owns the databases. + ## Building extensions + + This image enables `pkg-slim` (`docs`, `dev`, and `toolchain` tiers), which + strips headers, static archives, and compiler binaries while keeping + PostgreSQL, `pgvector`, and LLVM JIT working at runtime. Downstream builder + stages compiling extensions against this image should disable slimming and + reinstall the PostgreSQL headers first: + + ```dockerfile + RUN pkg-slim disable && \ + pkg update && \ + pkg install -fy postgresql${PG_VERSION}-client postgresql${PG_VERSION}-server gettext-runtime icu llvm19 + ``` + services: postgres: image: ghcr.io/daemonless/postgres:latest