Skip to content

Instantly share code, notes, and snippets.

@Archisman-Mridha
Created January 5, 2026 22:36
Show Gist options
  • Select an option

  • Save Archisman-Mridha/b857c7018162b9b9e1b8b3dfd40749a2 to your computer and use it in GitHub Desktop.

Select an option

Save Archisman-Mridha/b857c7018162b9b9e1b8b3dfd40749a2 to your computer and use it in GitHub Desktop.
FROM ubuntu:25.10 AS extension-builder
RUN apt-get -y update && \
apt-get install -y git make gcc postgresql-server-dev-17
FROM extension-builder AS pg-orphaned-builder
RUN git clone https://github.com/bdrouvot/pg_orphaned.git && \
cd pg_orphaned && \
make && \
make install
FROM extension-builder AS pg-auth-mon-builder
RUN apt-get install -y libkrb5-dev libssl-dev
RUN git clone https://github.com/RafiaSabih/pg_auth_mon && \
cd pg_auth_mon && \
make install
FROM ghcr.io/cloudnative-pg/postgresql:17.6-system-bookworm AS packager
USER root
RUN apt-get -y update
RUN apt-get -y install \
postgresql-17-dirtyread \
postgresql-17-extra-window-functions \
postgresql-17-first-last-agg \
postgresql-17-hypopg \
postgresql-17-partman \
postgresql-17-plproxy \
postgresql-17-decoderbufs \
postgresql-17-pllua \
postgresql-17-roaringbitmap \
postgresql-17-powa \
postgresql-17-pg-qualstats \
postgresql-17-pg-stat-kcache \
postgresql-17-pg-wait-sampling \
postgresql-17-pg-track-settings \
postgresql-17-pgfaceting \
pgbouncer \
skytools3-ticker \
libevent-dev libbrotli-dev
# Install the Citus extension.
RUN apt-get -y install curl
RUN curl https://install.citusdata.com/community/deb.sh | bash && \
apt-get -y install postgresql-17-citus-13.0 --no-install-recommends
# Install the pg_orphaned extension.
COPY --from=pg-orphaned-builder \
/pg_orphaned/pg_orphaned.so \
/usr/lib/postgresql/17/lib/
COPY --from=pg-orphaned-builder \
/pg_orphaned/pg_orphaned.control \
/usr/share/postgresql/17/extension/
COPY --from=pg-orphaned-builder \
/pg_orphaned/pg_orphaned--1.0.sql \
/usr/share/postgresql/17/extension/
# Install the pg_auth_mon extension.
COPY --from=pg-auth-mon-builder \
/pg_auth_mon/pg_auth_mon.so \
/usr/lib/postgresql/17/lib/
COPY --from=pg-auth-mon-builder \
/pg_auth_mon/pg_auth_mon.control \
/usr/share/postgresql/17/extension/
COPY --from=pg-auth-mon-builder \
/pg_auth_mon/pg_auth_mon--1.0.sql \
/usr/share/postgresql/17/extension/
USER postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment