Skip to content

Instantly share code, notes, and snippets.

@CodeKJ
Created March 4, 2025 19:53
Show Gist options
  • Save CodeKJ/7cc7460a48cc0e5c6a93caef7afbc51f to your computer and use it in GitHub Desktop.
Save CodeKJ/7cc7460a48cc0e5c6a93caef7afbc51f to your computer and use it in GitHub Desktop.
postgres:17-alpine + system_stats extension
FROM postgres:17-alpine
# Install required dependencies
RUN apk add --no-cache gcc musl-dev make g++ postgresql-dev git clang llvm llvm-dev
# Clone the system_stats repository from EnterpriseDB GitHub
RUN git clone --depth 1 https://github.com/EnterpriseDB/system_stats.git /build/system_stats
# Build and install the system_stats extension
WORKDIR /build/system_stats
RUN make && make install
# Clean up unnecessary dependencies
RUN apk del gcc musl-dev make g++ git \
&& rm -rf /build/system_stats /var/cache/apk/*
# Restore default working directory
WORKDIR /
@CodeKJ
Copy link
Author

CodeKJ commented Mar 4, 2025

run post install:

CREATE EXTENSION system_stats;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment