ARG PG_MAJOR=18 FROM postgres:$PG_MAJOR-trixie AS build WORKDIR /work COPY . . RUN apt-get update && apt-get install -y --no-install-recommends \ postgresql-server-dev-$PG_MAJOR \ libcurl4-openssl-dev \ uuid-dev \ make \ cmake \ libssl-dev \ libre2-dev \ pgxnclient \ unzip \ g++ RUN make && make install DESTDIR=/dest # Build the latest stable version of the re2 extension. RUN cd /tmp && pgxn download re2 && unzip re2-*.zip && rm re2-*.zip && cd re2-* && make && make install DESTDIR=/dest FROM postgres:$PG_MAJOR-trixie # Install dependencies RUN apt-get update && apt-get install -y --no-install-recommends libcurl4t64 uuid libre2-11 ca-certificates \ && apt-get clean \ && rm -rf /var/cache/apt/* /var/lib/apt/lists/* # Install extension files. COPY --chmod=644 --from=build \ /dest/usr/share/postgresql/$PG_MAJOR/extension/*.* \ /usr/share/postgresql/$PG_MAJOR/extension/ # Install shared libraries. COPY --chmod=755 --from=build \ /dest/usr/lib/postgresql/$PG_MAJOR/lib/*.so* \ /usr/lib/postgresql/$PG_MAJOR/lib/ # Install bitcode files. COPY --chmod=644 --from=build \ /dest/usr/lib/postgresql/$PG_MAJOR/lib/bitcode/*.bc \ /usr/lib/postgresql/$PG_MAJOR/lib/bitcode/ COPY --chmod=644 --from=build \ /dest/usr/lib/postgresql/$PG_MAJOR/lib/bitcode/pg_clickhouse/src/*.bc \ /usr/lib/postgresql/$PG_MAJOR/lib/bitcode/pg_clickhouse/src/