Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion Containerfile.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -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-*; \
Expand Down
3 changes: 2 additions & 1 deletion Containerfile.pkg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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-*; \
Expand Down
14 changes: 14 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down