From 1dea9b13cc767e41aa59aaef11faf8065b49e907 Mon Sep 17 00:00:00 2001 From: Sergio Moreno Date: Wed, 1 Oct 2025 23:11:11 +0200 Subject: [PATCH 1/7] feat(): upgrade to pg18 and upgrade to latest others --- .github/workflows/ci.yaml | 62 +++++++++++++++++----- pg15/Dockerfile | 2 +- pg15/Dockerfile-timescaledb | 2 +- pg16/Dockerfile | 2 +- pg16/Dockerfile-timescaledb | 2 +- pg17/Dockerfile | 2 +- pg17/Dockerfile-timescaledb | 2 +- pg18/Dockerfile | 96 +++++++++++++++++++++++++++++++++ pg18/Dockerfile-timescaledb | 102 ++++++++++++++++++++++++++++++++++++ 9 files changed, 254 insertions(+), 18 deletions(-) create mode 100644 pg18/Dockerfile create mode 100644 pg18/Dockerfile-timescaledb diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4a09398..85df494 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,7 +36,7 @@ jobs: uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=15.10 + PG_VERSION=15.14 PG_MAJOR_VERSION=15 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -44,14 +44,14 @@ jobs: push: true tags: | flyio/postgres-flex:15 - flyio/postgres-flex:15.10 + flyio/postgres-flex:15.14 - name: Build and push Postgres 15 Timescale DB id: docker_build_15_timescaledb uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=15.10 + PG_VERSION=15.14 PG_MAJOR_VERSION=15 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -59,7 +59,7 @@ jobs: push: true tags: | flyio/postgres-flex-timescaledb:15 - flyio/postgres-flex-timescaledb:15.10 + flyio/postgres-flex-timescaledb:15.14 - name: Build and push Postgres 16 @@ -67,7 +67,7 @@ jobs: uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=16.6 + PG_VERSION=16.10 PG_MAJOR_VERSION=16 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -75,14 +75,14 @@ jobs: push: true tags: | flyio/postgres-flex:16 - flyio/postgres-flex:16.6 + flyio/postgres-flex:16.10 - name: Build and push Postgres 16 Timescale DB id: docker_build_16_timescaledb uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=16.6 + PG_VERSION=16.10 PG_MAJOR_VERSION=16 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -90,7 +90,7 @@ jobs: push: true tags: | flyio/postgres-flex-timescaledb:16 - flyio/postgres-flex-timescaledb:16.6 + flyio/postgres-flex-timescaledb:16.10 - name: Build and push Postgres 17 @@ -98,7 +98,7 @@ jobs: uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=17.2 + PG_VERSION=17.6 PG_MAJOR_VERSION=17 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -106,14 +106,14 @@ jobs: push: true tags: | flyio/postgres-flex:17 - flyio/postgres-flex:17.2 + flyio/postgres-flex:17.6 - name: Build and push Postgres 17 Timescale DB id: docker_build_17_timescaledb uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=17.2 + PG_VERSION=17.6 PG_MAJOR_VERSION=17 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -121,7 +121,39 @@ jobs: push: true tags: | flyio/postgres-flex-timescaledb:17 - flyio/postgres-flex-timescaledb:17.2 + flyio/postgres-flex-timescaledb:17.6 + + - + name: Build and push Postgres 18 + id: docker_build_18 + uses: docker/build-push-action@v6 + with: + build-args: | + PG_VERSION=18.0 + PG_MAJOR_VERSION=18 + VERSION=${{ steps.get-latest-tag.outputs.tag }} + context: . + file: ./pg18/Dockerfile + push: true + tags: | + flyio/postgres-flex:18 + flyio/postgres-flex:18.0 + - + name: Build and push Postgres 18 Timescale DB + id: docker_build_18_timescaledb + uses: docker/build-push-action@v6 + with: + build-args: | + PG_VERSION=18.0 + PG_MAJOR_VERSION=18 + VERSION=${{ steps.get-latest-tag.outputs.tag }} + context: . + file: ./pg18/Dockerfile-timescaledb + push: true + tags: | + flyio/postgres-flex-timescaledb:18 + flyio/postgres-flex-timescaledb:18.0 + - name: Postgres 15 Image digest run: echo ${{ steps.docker_build_15.outputs.digest }} @@ -140,3 +172,9 @@ jobs: - name: Postgres 17 TimescaleDB Image digest run: echo ${{ steps.docker_build_17_timescaledb.outputs.digest }} + - + name: Postgres 18 Image digest + run: echo ${{ steps.docker_build_18.outputs.digest }} + - + name: Postgres 18 TimescaleDB Image digest + run: echo ${{ steps.docker_build_18_timescaledb.outputs.digest }} diff --git a/pg15/Dockerfile b/pg15/Dockerfile index 9611a1e..de023d5 100644 --- a/pg15/Dockerfile +++ b/pg15/Dockerfile @@ -1,4 +1,4 @@ -ARG PG_VERSION=15.10 +ARG PG_VERSION=15.14 ARG PG_MAJOR_VERSION=15 ARG VERSION=custom diff --git a/pg15/Dockerfile-timescaledb b/pg15/Dockerfile-timescaledb index 78c6942..a4f7db4 100644 --- a/pg15/Dockerfile-timescaledb +++ b/pg15/Dockerfile-timescaledb @@ -1,4 +1,4 @@ -ARG PG_VERSION=15.10 +ARG PG_VERSION=15.14 ARG PG_MAJOR_VERSION=15 ARG VERSION=custom diff --git a/pg16/Dockerfile b/pg16/Dockerfile index 0ec8914..85fa287 100644 --- a/pg16/Dockerfile +++ b/pg16/Dockerfile @@ -1,4 +1,4 @@ -ARG PG_VERSION=16.6 +ARG PG_VERSION=16.10 ARG PG_MAJOR_VERSION=16 ARG VERSION=custom diff --git a/pg16/Dockerfile-timescaledb b/pg16/Dockerfile-timescaledb index cdb92eb..9041036 100644 --- a/pg16/Dockerfile-timescaledb +++ b/pg16/Dockerfile-timescaledb @@ -1,4 +1,4 @@ -ARG PG_VERSION=16.6 +ARG PG_VERSION=16.10 ARG PG_MAJOR_VERSION=16 ARG VERSION=custom diff --git a/pg17/Dockerfile b/pg17/Dockerfile index 5b5fdf6..49253ed 100644 --- a/pg17/Dockerfile +++ b/pg17/Dockerfile @@ -1,4 +1,4 @@ -ARG PG_VERSION=17.2 +ARG PG_VERSION=17.6 ARG PG_MAJOR_VERSION=17 ARG VERSION=custom diff --git a/pg17/Dockerfile-timescaledb b/pg17/Dockerfile-timescaledb index 6790ee3..a6eb3b4 100644 --- a/pg17/Dockerfile-timescaledb +++ b/pg17/Dockerfile-timescaledb @@ -1,4 +1,4 @@ -ARG PG_VERSION=17.2 +ARG PG_VERSION=17.6 ARG PG_MAJOR_VERSION=17 ARG VERSION=custom diff --git a/pg18/Dockerfile b/pg18/Dockerfile new file mode 100644 index 0000000..f5e043e --- /dev/null +++ b/pg18/Dockerfile @@ -0,0 +1,96 @@ +ARG PG_VERSION=18.0 +ARG PG_MAJOR_VERSION=18 +ARG VERSION=custom + +FROM golang:1.23 AS builder + +WORKDIR /go/src/github.com/fly-apps/fly-postgres +COPY . . + +RUN CGO_ENABLED=0 GOOS=linux \ + go build -v -o /fly/bin/event_handler ./cmd/event_handler && \ + go build -v -o /fly/bin/failover_validation ./cmd/failover_validation && \ + go build -v -o /fly/bin/pg_unregister ./cmd/pg_unregister && \ + go build -v -o /fly/bin/start_monitor ./cmd/monitor && \ + go build -v -o /fly/bin/start_admin_server ./cmd/admin_server && \ + go build -v -o /fly/bin/start ./cmd/start && \ + go build -v -o /fly/bin/flexctl ./cmd/flexctl + + +COPY ./bin/* /fly/bin/ + +FROM ubuntu:24.04 + +ARG VERSION +ARG PG_MAJOR_VERSION +ARG PG_VERSION +ARG POSTGIS_MAJOR=3 +ARG HAPROXY_VERSION=2.8 +ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 + +ENV PGDATA=/data/postgresql +ENV PGPASSFILE=/data/.pgpass +ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials +ENV PG_MAJOR_VERSION=${PG_MAJOR_VERSION} +ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH" + + +LABEL fly.app_role=postgres_cluster +LABEL fly.version=${VERSION} +LABEL fly.pg-version=${PG_VERSION} +LABEL fly.pg-manager=repmgr + +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN set -eux; \ + if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \ + # if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales) + grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ + sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ + ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ + fi; \ + apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ + echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen; \ + locale-gen; \ + locale -a | grep 'en_US.utf8' +ENV LANG en_US.utf8 + +RUN apt-get update && apt-get install --no-install-recommends -y \ + ca-certificates iproute2 curl bash dnsutils vim socat procps ssh gnupg rsync barman-cli barman barman-cli-cloud python3-setuptools cron gosu \ + && apt autoremove -y && apt clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Install PostgreSQL +RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt/ noble-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ + apt-get update && apt-get install --no-install-recommends -y \ + postgresql-${PG_MAJOR_VERSION} \ + postgresql-client-${PG_MAJOR_VERSION} \ + postgresql-contrib-${PG_MAJOR_VERSION} \ + postgresql-${PG_MAJOR_VERSION}-repmgr=${REPMGR_VERSION} + +# PostGIS +RUN apt-get update && apt-get install --no-install-recommends -y \ + postgresql-${PG_MAJOR_VERSION}-postgis-$POSTGIS_MAJOR \ + postgresql-${PG_MAJOR_VERSION}-postgis-$POSTGIS_MAJOR-scripts + +# Haproxy +RUN apt-get update && apt-get install --no-install-recommends -y \ + haproxy=$HAPROXY_VERSION.\* \ + && apt autoremove -y && apt clean + +# Copy Go binaries from the builder stage +COPY --from=builder /fly/bin/* /usr/local/bin + +# Copy Postgres exporter +COPY --from=wrouesnel/postgres_exporter:latest /postgres_exporter /usr/local/bin/ + +# Move pg_rewind into path. +RUN ln -s /usr/lib/postgresql/${PG_MAJOR_VERSION}/bin/pg_rewind /usr/bin/pg_rewind + +ADD /config/* /fly/ +RUN mkdir -p /run/haproxy/ +RUN usermod -d /data postgres + +EXPOSE 5432 + +CMD ["start"] diff --git a/pg18/Dockerfile-timescaledb b/pg18/Dockerfile-timescaledb new file mode 100644 index 0000000..5e8af1e --- /dev/null +++ b/pg18/Dockerfile-timescaledb @@ -0,0 +1,102 @@ +ARG PG_VERSION=18.0 +ARG PG_MAJOR_VERSION=18 +ARG VERSION=custom + +FROM golang:1.23 AS builder + +WORKDIR /go/src/github.com/fly-apps/fly-postgres +COPY . . + +RUN CGO_ENABLED=0 GOOS=linux \ + go build -v -o /fly/bin/event_handler ./cmd/event_handler && \ + go build -v -o /fly/bin/failover_validation ./cmd/failover_validation && \ + go build -v -o /fly/bin/pg_unregister ./cmd/pg_unregister && \ + go build -v -o /fly/bin/start_monitor ./cmd/monitor && \ + go build -v -o /fly/bin/start_admin_server ./cmd/admin_server && \ + go build -v -o /fly/bin/start ./cmd/start && \ + go build -v -o /fly/bin/flexctl ./cmd/flexctl + + +COPY ./bin/* /fly/bin/ + +FROM ubuntu:24.04 + +ARG VERSION +ARG PG_MAJOR_VERSION +ARG PG_VERSION +ARG POSTGIS_MAJOR=3 +ARG HAPROXY_VERSION=2.8 +ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 + +ENV PGDATA=/data/postgresql +ENV PGPASSFILE=/data/.pgpass +ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials +ENV PG_MAJOR_VERSION=${PG_MAJOR_VERSION} +ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH" + +LABEL fly.app_role=postgres_cluster +LABEL fly.version=${VERSION} +LABEL fly.pg-version=${PG_VERSION} +LABEL fly.pg-manager=repmgr + +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN set -eux; \ + if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \ + # if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales) + grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ + sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ + ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ + fi; \ + apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ + echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen; \ + locale-gen; \ + locale -a | grep 'en_US.utf8' +ENV LANG en_US.utf8 + +RUN apt-get update && apt-get install --no-install-recommends -y \ + ca-certificates iproute2 curl bash dnsutils vim socat procps ssh gnupg rsync barman-cli barman barman-cli-cloud python3-setuptools cron gosu \ + && apt autoremove -y && apt clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Install PostgreSQL +RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt/ noble-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ + apt-get update && apt-get install --no-install-recommends -y \ + postgresql-${PG_MAJOR_VERSION} \ + postgresql-client-${PG_MAJOR_VERSION} \ + postgresql-contrib-${PG_MAJOR_VERSION} \ + postgresql-${PG_MAJOR_VERSION}-repmgr=${REPMGR_VERSION} + +# TimescaleDB and PostGIS +RUN echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ jammy main" > /etc/apt/sources.list.d/timescaledb.list \ + && curl -L https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add - + +RUN apt-get update && apt-get install --no-install-recommends -y \ + postgresql-$PG_MAJOR_VERSION-postgis-$POSTGIS_MAJOR \ + postgresql-$PG_MAJOR_VERSION-postgis-$POSTGIS_MAJOR-scripts \ + timescaledb-2-postgresql-$PG_MAJOR_VERSION \ + && apt autoremove -y && apt clean + +# Haproxy +RUN apt-get update && apt-get install --no-install-recommends -y \ + haproxy=$HAPROXY_VERSION.\* \ + && apt autoremove -y && apt clean + +# Copy Go binaries from the builder stage +COPY --from=builder /fly/bin/* /usr/local/bin + +# Copy Postgres exporter +COPY --from=wrouesnel/postgres_exporter:latest /postgres_exporter /usr/local/bin/ + +# Move pg_rewind into path. +RUN ln -s /usr/lib/postgresql/${PG_MAJOR_VERSION}/bin/pg_rewind /usr/bin/pg_rewind + +ADD /config/* /fly/ +RUN mkdir -p /run/haproxy/ +RUN usermod -d /data postgres + +ENV TIMESCALEDB_ENABLED=true + +EXPOSE 5432 + +CMD ["start"] From 42bc9eedf18473f11278a4c8412f8a24425799ca Mon Sep 17 00:00:00 2001 From: Sergio Moreno Date: Wed, 1 Oct 2025 23:26:08 +0200 Subject: [PATCH 2/7] chore: remove pg 18 due repmgr compatbility --- .github/workflows/ci.yaml | 36 ------------- pg18/Dockerfile | 96 --------------------------------- pg18/Dockerfile-timescaledb | 102 ------------------------------------ 3 files changed, 234 deletions(-) delete mode 100644 pg18/Dockerfile delete mode 100644 pg18/Dockerfile-timescaledb diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 85df494..9f430bd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -123,36 +123,6 @@ jobs: flyio/postgres-flex-timescaledb:17 flyio/postgres-flex-timescaledb:17.6 - - - name: Build and push Postgres 18 - id: docker_build_18 - uses: docker/build-push-action@v6 - with: - build-args: | - PG_VERSION=18.0 - PG_MAJOR_VERSION=18 - VERSION=${{ steps.get-latest-tag.outputs.tag }} - context: . - file: ./pg18/Dockerfile - push: true - tags: | - flyio/postgres-flex:18 - flyio/postgres-flex:18.0 - - - name: Build and push Postgres 18 Timescale DB - id: docker_build_18_timescaledb - uses: docker/build-push-action@v6 - with: - build-args: | - PG_VERSION=18.0 - PG_MAJOR_VERSION=18 - VERSION=${{ steps.get-latest-tag.outputs.tag }} - context: . - file: ./pg18/Dockerfile-timescaledb - push: true - tags: | - flyio/postgres-flex-timescaledb:18 - flyio/postgres-flex-timescaledb:18.0 - name: Postgres 15 Image digest @@ -172,9 +142,3 @@ jobs: - name: Postgres 17 TimescaleDB Image digest run: echo ${{ steps.docker_build_17_timescaledb.outputs.digest }} - - - name: Postgres 18 Image digest - run: echo ${{ steps.docker_build_18.outputs.digest }} - - - name: Postgres 18 TimescaleDB Image digest - run: echo ${{ steps.docker_build_18_timescaledb.outputs.digest }} diff --git a/pg18/Dockerfile b/pg18/Dockerfile deleted file mode 100644 index f5e043e..0000000 --- a/pg18/Dockerfile +++ /dev/null @@ -1,96 +0,0 @@ -ARG PG_VERSION=18.0 -ARG PG_MAJOR_VERSION=18 -ARG VERSION=custom - -FROM golang:1.23 AS builder - -WORKDIR /go/src/github.com/fly-apps/fly-postgres -COPY . . - -RUN CGO_ENABLED=0 GOOS=linux \ - go build -v -o /fly/bin/event_handler ./cmd/event_handler && \ - go build -v -o /fly/bin/failover_validation ./cmd/failover_validation && \ - go build -v -o /fly/bin/pg_unregister ./cmd/pg_unregister && \ - go build -v -o /fly/bin/start_monitor ./cmd/monitor && \ - go build -v -o /fly/bin/start_admin_server ./cmd/admin_server && \ - go build -v -o /fly/bin/start ./cmd/start && \ - go build -v -o /fly/bin/flexctl ./cmd/flexctl - - -COPY ./bin/* /fly/bin/ - -FROM ubuntu:24.04 - -ARG VERSION -ARG PG_MAJOR_VERSION -ARG PG_VERSION -ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=2.8 -ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 - -ENV PGDATA=/data/postgresql -ENV PGPASSFILE=/data/.pgpass -ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials -ENV PG_MAJOR_VERSION=${PG_MAJOR_VERSION} -ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH" - - -LABEL fly.app_role=postgres_cluster -LABEL fly.version=${VERSION} -LABEL fly.pg-version=${PG_VERSION} -LABEL fly.pg-manager=repmgr - -# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default -RUN set -eux; \ - if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \ - # if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales) - grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ - sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ - ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ - fi; \ - apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ - echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen; \ - locale-gen; \ - locale -a | grep 'en_US.utf8' -ENV LANG en_US.utf8 - -RUN apt-get update && apt-get install --no-install-recommends -y \ - ca-certificates iproute2 curl bash dnsutils vim socat procps ssh gnupg rsync barman-cli barman barman-cli-cloud python3-setuptools cron gosu \ - && apt autoremove -y && apt clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# Install PostgreSQL -RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg && \ - echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt/ noble-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ - apt-get update && apt-get install --no-install-recommends -y \ - postgresql-${PG_MAJOR_VERSION} \ - postgresql-client-${PG_MAJOR_VERSION} \ - postgresql-contrib-${PG_MAJOR_VERSION} \ - postgresql-${PG_MAJOR_VERSION}-repmgr=${REPMGR_VERSION} - -# PostGIS -RUN apt-get update && apt-get install --no-install-recommends -y \ - postgresql-${PG_MAJOR_VERSION}-postgis-$POSTGIS_MAJOR \ - postgresql-${PG_MAJOR_VERSION}-postgis-$POSTGIS_MAJOR-scripts - -# Haproxy -RUN apt-get update && apt-get install --no-install-recommends -y \ - haproxy=$HAPROXY_VERSION.\* \ - && apt autoremove -y && apt clean - -# Copy Go binaries from the builder stage -COPY --from=builder /fly/bin/* /usr/local/bin - -# Copy Postgres exporter -COPY --from=wrouesnel/postgres_exporter:latest /postgres_exporter /usr/local/bin/ - -# Move pg_rewind into path. -RUN ln -s /usr/lib/postgresql/${PG_MAJOR_VERSION}/bin/pg_rewind /usr/bin/pg_rewind - -ADD /config/* /fly/ -RUN mkdir -p /run/haproxy/ -RUN usermod -d /data postgres - -EXPOSE 5432 - -CMD ["start"] diff --git a/pg18/Dockerfile-timescaledb b/pg18/Dockerfile-timescaledb deleted file mode 100644 index 5e8af1e..0000000 --- a/pg18/Dockerfile-timescaledb +++ /dev/null @@ -1,102 +0,0 @@ -ARG PG_VERSION=18.0 -ARG PG_MAJOR_VERSION=18 -ARG VERSION=custom - -FROM golang:1.23 AS builder - -WORKDIR /go/src/github.com/fly-apps/fly-postgres -COPY . . - -RUN CGO_ENABLED=0 GOOS=linux \ - go build -v -o /fly/bin/event_handler ./cmd/event_handler && \ - go build -v -o /fly/bin/failover_validation ./cmd/failover_validation && \ - go build -v -o /fly/bin/pg_unregister ./cmd/pg_unregister && \ - go build -v -o /fly/bin/start_monitor ./cmd/monitor && \ - go build -v -o /fly/bin/start_admin_server ./cmd/admin_server && \ - go build -v -o /fly/bin/start ./cmd/start && \ - go build -v -o /fly/bin/flexctl ./cmd/flexctl - - -COPY ./bin/* /fly/bin/ - -FROM ubuntu:24.04 - -ARG VERSION -ARG PG_MAJOR_VERSION -ARG PG_VERSION -ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=2.8 -ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 - -ENV PGDATA=/data/postgresql -ENV PGPASSFILE=/data/.pgpass -ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials -ENV PG_MAJOR_VERSION=${PG_MAJOR_VERSION} -ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH" - -LABEL fly.app_role=postgres_cluster -LABEL fly.version=${VERSION} -LABEL fly.pg-version=${PG_VERSION} -LABEL fly.pg-manager=repmgr - -# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default -RUN set -eux; \ - if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \ - # if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales) - grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ - sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ - ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ - fi; \ - apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ - echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen; \ - locale-gen; \ - locale -a | grep 'en_US.utf8' -ENV LANG en_US.utf8 - -RUN apt-get update && apt-get install --no-install-recommends -y \ - ca-certificates iproute2 curl bash dnsutils vim socat procps ssh gnupg rsync barman-cli barman barman-cli-cloud python3-setuptools cron gosu \ - && apt autoremove -y && apt clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# Install PostgreSQL -RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg && \ - echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt/ noble-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ - apt-get update && apt-get install --no-install-recommends -y \ - postgresql-${PG_MAJOR_VERSION} \ - postgresql-client-${PG_MAJOR_VERSION} \ - postgresql-contrib-${PG_MAJOR_VERSION} \ - postgresql-${PG_MAJOR_VERSION}-repmgr=${REPMGR_VERSION} - -# TimescaleDB and PostGIS -RUN echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ jammy main" > /etc/apt/sources.list.d/timescaledb.list \ - && curl -L https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add - - -RUN apt-get update && apt-get install --no-install-recommends -y \ - postgresql-$PG_MAJOR_VERSION-postgis-$POSTGIS_MAJOR \ - postgresql-$PG_MAJOR_VERSION-postgis-$POSTGIS_MAJOR-scripts \ - timescaledb-2-postgresql-$PG_MAJOR_VERSION \ - && apt autoremove -y && apt clean - -# Haproxy -RUN apt-get update && apt-get install --no-install-recommends -y \ - haproxy=$HAPROXY_VERSION.\* \ - && apt autoremove -y && apt clean - -# Copy Go binaries from the builder stage -COPY --from=builder /fly/bin/* /usr/local/bin - -# Copy Postgres exporter -COPY --from=wrouesnel/postgres_exporter:latest /postgres_exporter /usr/local/bin/ - -# Move pg_rewind into path. -RUN ln -s /usr/lib/postgresql/${PG_MAJOR_VERSION}/bin/pg_rewind /usr/bin/pg_rewind - -ADD /config/* /fly/ -RUN mkdir -p /run/haproxy/ -RUN usermod -d /data postgres - -ENV TIMESCALEDB_ENABLED=true - -EXPOSE 5432 - -CMD ["start"] From 3c609c34e663949154c571378d214c43e924b083 Mon Sep 17 00:00:00 2001 From: Sergio Moreno Date: Mon, 5 Jan 2026 13:01:50 +0100 Subject: [PATCH 3/7] Revert "chore: remove pg 18 due repmgr compatbility" This reverts commit 42bc9eedf18473f11278a4c8412f8a24425799ca. --- .github/workflows/ci.yaml | 36 +++++++++++++ pg18/Dockerfile | 96 +++++++++++++++++++++++++++++++++ pg18/Dockerfile-timescaledb | 102 ++++++++++++++++++++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 pg18/Dockerfile create mode 100644 pg18/Dockerfile-timescaledb diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9f430bd..c247b5a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -123,6 +123,36 @@ jobs: flyio/postgres-flex-timescaledb:17 flyio/postgres-flex-timescaledb:17.6 + - + name: Build and push Postgres 18 + id: docker_build_18 + uses: docker/build-push-action@v6 + with: + build-args: | + PG_VERSION=18.1 + PG_MAJOR_VERSION=18 + VERSION=${{ steps.get-latest-tag.outputs.tag }} + context: . + file: ./pg18/Dockerfile + push: true + tags: | + flyio/postgres-flex:18 + flyio/postgres-flex:18.1 + - + name: Build and push Postgres 18 Timescale DB + id: docker_build_18_timescaledb + uses: docker/build-push-action@v6 + with: + build-args: | + PG_VERSION=18.1 + PG_MAJOR_VERSION=18 + VERSION=${{ steps.get-latest-tag.outputs.tag }} + context: . + file: ./pg18/Dockerfile-timescaledb + push: true + tags: | + flyio/postgres-flex-timescaledb:18 + flyio/postgres-flex-timescaledb:18.1 - name: Postgres 15 Image digest @@ -142,3 +172,9 @@ jobs: - name: Postgres 17 TimescaleDB Image digest run: echo ${{ steps.docker_build_17_timescaledb.outputs.digest }} + - + name: Postgres 18 Image digest + run: echo ${{ steps.docker_build_18.outputs.digest }} + - + name: Postgres 18 TimescaleDB Image digest + run: echo ${{ steps.docker_build_18_timescaledb.outputs.digest }} diff --git a/pg18/Dockerfile b/pg18/Dockerfile new file mode 100644 index 0000000..0652898 --- /dev/null +++ b/pg18/Dockerfile @@ -0,0 +1,96 @@ +ARG PG_VERSION=18.1 +ARG PG_MAJOR_VERSION=18 +ARG VERSION=custom + +FROM golang:1.23 AS builder + +WORKDIR /go/src/github.com/fly-apps/fly-postgres +COPY . . + +RUN CGO_ENABLED=0 GOOS=linux \ + go build -v -o /fly/bin/event_handler ./cmd/event_handler && \ + go build -v -o /fly/bin/failover_validation ./cmd/failover_validation && \ + go build -v -o /fly/bin/pg_unregister ./cmd/pg_unregister && \ + go build -v -o /fly/bin/start_monitor ./cmd/monitor && \ + go build -v -o /fly/bin/start_admin_server ./cmd/admin_server && \ + go build -v -o /fly/bin/start ./cmd/start && \ + go build -v -o /fly/bin/flexctl ./cmd/flexctl + + +COPY ./bin/* /fly/bin/ + +FROM ubuntu:24.04 + +ARG VERSION +ARG PG_MAJOR_VERSION +ARG PG_VERSION +ARG POSTGIS_MAJOR=3 +ARG HAPROXY_VERSION=2.8 +ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 + +ENV PGDATA=/data/postgresql +ENV PGPASSFILE=/data/.pgpass +ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials +ENV PG_MAJOR_VERSION=${PG_MAJOR_VERSION} +ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH" + + +LABEL fly.app_role=postgres_cluster +LABEL fly.version=${VERSION} +LABEL fly.pg-version=${PG_VERSION} +LABEL fly.pg-manager=repmgr + +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN set -eux; \ + if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \ + # if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales) + grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ + sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ + ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ + fi; \ + apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ + echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen; \ + locale-gen; \ + locale -a | grep 'en_US.utf8' +ENV LANG en_US.utf8 + +RUN apt-get update && apt-get install --no-install-recommends -y \ + ca-certificates iproute2 curl bash dnsutils vim socat procps ssh gnupg rsync barman-cli barman barman-cli-cloud python3-setuptools cron gosu \ + && apt autoremove -y && apt clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Install PostgreSQL +RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt/ noble-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ + apt-get update && apt-get install --no-install-recommends -y \ + postgresql-${PG_MAJOR_VERSION} \ + postgresql-client-${PG_MAJOR_VERSION} \ + postgresql-contrib-${PG_MAJOR_VERSION} \ + postgresql-${PG_MAJOR_VERSION}-repmgr=${REPMGR_VERSION} + +# PostGIS +RUN apt-get update && apt-get install --no-install-recommends -y \ + postgresql-${PG_MAJOR_VERSION}-postgis-$POSTGIS_MAJOR \ + postgresql-${PG_MAJOR_VERSION}-postgis-$POSTGIS_MAJOR-scripts + +# Haproxy +RUN apt-get update && apt-get install --no-install-recommends -y \ + haproxy=$HAPROXY_VERSION.\* \ + && apt autoremove -y && apt clean + +# Copy Go binaries from the builder stage +COPY --from=builder /fly/bin/* /usr/local/bin + +# Copy Postgres exporter +COPY --from=wrouesnel/postgres_exporter:latest /postgres_exporter /usr/local/bin/ + +# Move pg_rewind into path. +RUN ln -s /usr/lib/postgresql/${PG_MAJOR_VERSION}/bin/pg_rewind /usr/bin/pg_rewind + +ADD /config/* /fly/ +RUN mkdir -p /run/haproxy/ +RUN usermod -d /data postgres + +EXPOSE 5432 + +CMD ["start"] diff --git a/pg18/Dockerfile-timescaledb b/pg18/Dockerfile-timescaledb new file mode 100644 index 0000000..dc1d1ec --- /dev/null +++ b/pg18/Dockerfile-timescaledb @@ -0,0 +1,102 @@ +ARG PG_VERSION=18.1 +ARG PG_MAJOR_VERSION=18 +ARG VERSION=custom + +FROM golang:1.23 AS builder + +WORKDIR /go/src/github.com/fly-apps/fly-postgres +COPY . . + +RUN CGO_ENABLED=0 GOOS=linux \ + go build -v -o /fly/bin/event_handler ./cmd/event_handler && \ + go build -v -o /fly/bin/failover_validation ./cmd/failover_validation && \ + go build -v -o /fly/bin/pg_unregister ./cmd/pg_unregister && \ + go build -v -o /fly/bin/start_monitor ./cmd/monitor && \ + go build -v -o /fly/bin/start_admin_server ./cmd/admin_server && \ + go build -v -o /fly/bin/start ./cmd/start && \ + go build -v -o /fly/bin/flexctl ./cmd/flexctl + + +COPY ./bin/* /fly/bin/ + +FROM ubuntu:24.04 + +ARG VERSION +ARG PG_MAJOR_VERSION +ARG PG_VERSION +ARG POSTGIS_MAJOR=3 +ARG HAPROXY_VERSION=2.8 +ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 + +ENV PGDATA=/data/postgresql +ENV PGPASSFILE=/data/.pgpass +ENV AWS_SHARED_CREDENTIALS_FILE=/data/.aws/credentials +ENV PG_MAJOR_VERSION=${PG_MAJOR_VERSION} +ENV PATH="/usr/lib/postgresql/${PG_MAJOR_VERSION}/bin:$PATH" + +LABEL fly.app_role=postgres_cluster +LABEL fly.version=${VERSION} +LABEL fly.pg-version=${PG_VERSION} +LABEL fly.pg-manager=repmgr + +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN set -eux; \ + if [ -f /etc/dpkg/dpkg.cfg.d/docker ]; then \ + # if this file exists, we're likely in "debian:xxx-slim", and locales are thus being excluded so we need to remove that exclusion (since we need locales) + grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ + sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \ + ! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \ + fi; \ + apt-get update; apt-get install -y --no-install-recommends locales; rm -rf /var/lib/apt/lists/*; \ + echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen; \ + locale-gen; \ + locale -a | grep 'en_US.utf8' +ENV LANG en_US.utf8 + +RUN apt-get update && apt-get install --no-install-recommends -y \ + ca-certificates iproute2 curl bash dnsutils vim socat procps ssh gnupg rsync barman-cli barman barman-cli-cloud python3-setuptools cron gosu \ + && apt autoremove -y && apt clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Install PostgreSQL +RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt/ noble-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ + apt-get update && apt-get install --no-install-recommends -y \ + postgresql-${PG_MAJOR_VERSION} \ + postgresql-client-${PG_MAJOR_VERSION} \ + postgresql-contrib-${PG_MAJOR_VERSION} \ + postgresql-${PG_MAJOR_VERSION}-repmgr=${REPMGR_VERSION} + +# TimescaleDB and PostGIS +RUN echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ jammy main" > /etc/apt/sources.list.d/timescaledb.list \ + && curl -L https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add - + +RUN apt-get update && apt-get install --no-install-recommends -y \ + postgresql-$PG_MAJOR_VERSION-postgis-$POSTGIS_MAJOR \ + postgresql-$PG_MAJOR_VERSION-postgis-$POSTGIS_MAJOR-scripts \ + timescaledb-2-postgresql-$PG_MAJOR_VERSION \ + && apt autoremove -y && apt clean + +# Haproxy +RUN apt-get update && apt-get install --no-install-recommends -y \ + haproxy=$HAPROXY_VERSION.\* \ + && apt autoremove -y && apt clean + +# Copy Go binaries from the builder stage +COPY --from=builder /fly/bin/* /usr/local/bin + +# Copy Postgres exporter +COPY --from=wrouesnel/postgres_exporter:latest /postgres_exporter /usr/local/bin/ + +# Move pg_rewind into path. +RUN ln -s /usr/lib/postgresql/${PG_MAJOR_VERSION}/bin/pg_rewind /usr/bin/pg_rewind + +ADD /config/* /fly/ +RUN mkdir -p /run/haproxy/ +RUN usermod -d /data postgres + +ENV TIMESCALEDB_ENABLED=true + +EXPOSE 5432 + +CMD ["start"] From 1399d1c06538fa951c19c81d605dab653b2ae062 Mon Sep 17 00:00:00 2001 From: Sergio Moreno Date: Mon, 5 Jan 2026 13:06:58 +0100 Subject: [PATCH 4/7] feat: upgrade haproxy to latest --- pg15/Dockerfile | 2 +- pg15/Dockerfile-timescaledb | 2 +- pg16/Dockerfile | 2 +- pg16/Dockerfile-timescaledb | 2 +- pg17/Dockerfile | 2 +- pg17/Dockerfile-timescaledb | 2 +- pg18/Dockerfile | 2 +- pg18/Dockerfile-timescaledb | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pg15/Dockerfile b/pg15/Dockerfile index de023d5..7356033 100644 --- a/pg15/Dockerfile +++ b/pg15/Dockerfile @@ -28,7 +28,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=2.8 +ARG HAPROXY_VERSION=3.3 LABEL fly.app_role=postgres_cluster LABEL fly.version=${VERSION} diff --git a/pg15/Dockerfile-timescaledb b/pg15/Dockerfile-timescaledb index a4f7db4..ad04a67 100644 --- a/pg15/Dockerfile-timescaledb +++ b/pg15/Dockerfile-timescaledb @@ -29,7 +29,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=2.8 +ARG HAPROXY_VERSION=3.3 LABEL fly.app_role=postgres_cluster LABEL fly.version=${VERSION} diff --git a/pg16/Dockerfile b/pg16/Dockerfile index 85fa287..0585c34 100644 --- a/pg16/Dockerfile +++ b/pg16/Dockerfile @@ -25,7 +25,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=2.8 +ARG HAPROXY_VERSION=3.3 ARG REPMGR_VERSION=5.4.1-1build2 ENV PGDATA=/data/postgresql diff --git a/pg16/Dockerfile-timescaledb b/pg16/Dockerfile-timescaledb index 9041036..094bbb7 100644 --- a/pg16/Dockerfile-timescaledb +++ b/pg16/Dockerfile-timescaledb @@ -25,7 +25,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=2.8 +ARG HAPROXY_VERSION=3.3 ARG REPMGR_VERSION=5.4.1-1build2 ENV PGDATA=/data/postgresql diff --git a/pg17/Dockerfile b/pg17/Dockerfile index 49253ed..d131f7c 100644 --- a/pg17/Dockerfile +++ b/pg17/Dockerfile @@ -25,7 +25,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=2.8 +ARG HAPROXY_VERSION=3.3 ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 ENV PGDATA=/data/postgresql diff --git a/pg17/Dockerfile-timescaledb b/pg17/Dockerfile-timescaledb index a6eb3b4..2096d3a 100644 --- a/pg17/Dockerfile-timescaledb +++ b/pg17/Dockerfile-timescaledb @@ -25,7 +25,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=2.8 +ARG HAPROXY_VERSION=3.3 ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 ENV PGDATA=/data/postgresql diff --git a/pg18/Dockerfile b/pg18/Dockerfile index 0652898..7e19e6a 100644 --- a/pg18/Dockerfile +++ b/pg18/Dockerfile @@ -25,7 +25,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=2.8 +ARG HAPROXY_VERSION=3.3 ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 ENV PGDATA=/data/postgresql diff --git a/pg18/Dockerfile-timescaledb b/pg18/Dockerfile-timescaledb index dc1d1ec..3f16479 100644 --- a/pg18/Dockerfile-timescaledb +++ b/pg18/Dockerfile-timescaledb @@ -25,7 +25,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=2.8 +ARG HAPROXY_VERSION=3.3 ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 ENV PGDATA=/data/postgresql From db7ca121223e37669efdbad5d50ca6b3ff02d662 Mon Sep 17 00:00:00 2001 From: Sergio Moreno Date: Mon, 5 Jan 2026 13:08:25 +0100 Subject: [PATCH 5/7] chore: fix conflicts --- pg17/Dockerfile | 2 +- pg17/Dockerfile-timescaledb | 2 +- pg18/Dockerfile | 2 +- pg18/Dockerfile-timescaledb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pg17/Dockerfile b/pg17/Dockerfile index d131f7c..7afef7d 100644 --- a/pg17/Dockerfile +++ b/pg17/Dockerfile @@ -26,7 +26,7 @@ ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 ARG HAPROXY_VERSION=3.3 -ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 +ARG REPMGR_VERSION=5.5.0+debpgdg-3.pgdg24.04+1 ENV PGDATA=/data/postgresql ENV PGPASSFILE=/data/.pgpass diff --git a/pg17/Dockerfile-timescaledb b/pg17/Dockerfile-timescaledb index 2096d3a..cab1672 100644 --- a/pg17/Dockerfile-timescaledb +++ b/pg17/Dockerfile-timescaledb @@ -26,7 +26,7 @@ ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 ARG HAPROXY_VERSION=3.3 -ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 +ARG REPMGR_VERSION=5.5.0+debpgdg-3.pgdg24.04+1 ENV PGDATA=/data/postgresql ENV PGPASSFILE=/data/.pgpass diff --git a/pg18/Dockerfile b/pg18/Dockerfile index 7e19e6a..96d25fb 100644 --- a/pg18/Dockerfile +++ b/pg18/Dockerfile @@ -26,7 +26,7 @@ ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 ARG HAPROXY_VERSION=3.3 -ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 +ARG REPMGR_VERSION=5.5.0+debpgdg-3.pgdg24.04+1 ENV PGDATA=/data/postgresql ENV PGPASSFILE=/data/.pgpass diff --git a/pg18/Dockerfile-timescaledb b/pg18/Dockerfile-timescaledb index 3f16479..21b6f83 100644 --- a/pg18/Dockerfile-timescaledb +++ b/pg18/Dockerfile-timescaledb @@ -26,7 +26,7 @@ ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 ARG HAPROXY_VERSION=3.3 -ARG REPMGR_VERSION=5.5.0+debpgdg-1.pgdg24.04+1 +ARG REPMGR_VERSION=5.5.0+debpgdg-3.pgdg24.04+1 ENV PGDATA=/data/postgresql ENV PGPASSFILE=/data/.pgpass From d52c3f3b62ed07093a6d9389e86a8670c2d14550 Mon Sep 17 00:00:00 2001 From: Sergio Moreno Date: Mon, 5 Jan 2026 13:11:56 +0100 Subject: [PATCH 6/7] chore: upgrade minors --- .github/workflows/ci.yaml | 24 ++++++++++++------------ pg15/Dockerfile | 2 +- pg15/Dockerfile-timescaledb | 2 +- pg16/Dockerfile | 2 +- pg16/Dockerfile-timescaledb | 2 +- pg17/Dockerfile | 2 +- pg17/Dockerfile-timescaledb | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7a27103..d249ce7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,7 +36,7 @@ jobs: uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=15.14 + PG_VERSION=15.15 PG_MAJOR_VERSION=15 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -44,14 +44,14 @@ jobs: push: true tags: | flyio/postgres-flex:15 - flyio/postgres-flex:15.14 + flyio/postgres-flex:15.15 - name: Build and push Postgres 15 Timescale DB id: docker_build_15_timescaledb uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=15.14 + PG_VERSION=15.15 PG_MAJOR_VERSION=15 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -59,7 +59,7 @@ jobs: push: true tags: | flyio/postgres-flex-timescaledb:15 - flyio/postgres-flex-timescaledb:15.14 + flyio/postgres-flex-timescaledb:15.15 - name: Build and push Postgres 16 @@ -67,7 +67,7 @@ jobs: uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=16.10 + PG_VERSION=16.11 PG_MAJOR_VERSION=16 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -75,14 +75,14 @@ jobs: push: true tags: | flyio/postgres-flex:16 - flyio/postgres-flex:16.10 + flyio/postgres-flex:16.11 - name: Build and push Postgres 16 Timescale DB id: docker_build_16_timescaledb uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=16.10 + PG_VERSION=16.11 PG_MAJOR_VERSION=16 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -90,7 +90,7 @@ jobs: push: true tags: | flyio/postgres-flex-timescaledb:16 - flyio/postgres-flex-timescaledb:16.10 + flyio/postgres-flex-timescaledb:16.11 - name: Build and push Postgres 17 @@ -98,7 +98,7 @@ jobs: uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=17.6 + PG_VERSION=17.7 PG_MAJOR_VERSION=17 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -106,14 +106,14 @@ jobs: push: true tags: | flyio/postgres-flex:17 - flyio/postgres-flex:17.6 + flyio/postgres-flex:17.7 - name: Build and push Postgres 17 Timescale DB id: docker_build_17_timescaledb uses: docker/build-push-action@v6 with: build-args: | - PG_VERSION=17.6 + PG_VERSION=17.7 PG_MAJOR_VERSION=17 VERSION=${{ steps.get-latest-tag.outputs.tag }} context: . @@ -121,7 +121,7 @@ jobs: push: true tags: | flyio/postgres-flex-timescaledb:17 - flyio/postgres-flex-timescaledb:17.6 + flyio/postgres-flex-timescaledb:17.7 - name: Build and push Postgres 18 diff --git a/pg15/Dockerfile b/pg15/Dockerfile index 7356033..c5bbb4c 100644 --- a/pg15/Dockerfile +++ b/pg15/Dockerfile @@ -1,4 +1,4 @@ -ARG PG_VERSION=15.14 +ARG PG_VERSION=15.15 ARG PG_MAJOR_VERSION=15 ARG VERSION=custom diff --git a/pg15/Dockerfile-timescaledb b/pg15/Dockerfile-timescaledb index ad04a67..1f5502f 100644 --- a/pg15/Dockerfile-timescaledb +++ b/pg15/Dockerfile-timescaledb @@ -1,4 +1,4 @@ -ARG PG_VERSION=15.14 +ARG PG_VERSION=15.15 ARG PG_MAJOR_VERSION=15 ARG VERSION=custom diff --git a/pg16/Dockerfile b/pg16/Dockerfile index 0585c34..43a95ab 100644 --- a/pg16/Dockerfile +++ b/pg16/Dockerfile @@ -1,4 +1,4 @@ -ARG PG_VERSION=16.10 +ARG PG_VERSION=16.11 ARG PG_MAJOR_VERSION=16 ARG VERSION=custom diff --git a/pg16/Dockerfile-timescaledb b/pg16/Dockerfile-timescaledb index 094bbb7..cd088c0 100644 --- a/pg16/Dockerfile-timescaledb +++ b/pg16/Dockerfile-timescaledb @@ -1,4 +1,4 @@ -ARG PG_VERSION=16.10 +ARG PG_VERSION=16.11 ARG PG_MAJOR_VERSION=16 ARG VERSION=custom diff --git a/pg17/Dockerfile b/pg17/Dockerfile index 7afef7d..d78b25f 100644 --- a/pg17/Dockerfile +++ b/pg17/Dockerfile @@ -1,4 +1,4 @@ -ARG PG_VERSION=17.6 +ARG PG_VERSION=17.7 ARG PG_MAJOR_VERSION=17 ARG VERSION=custom diff --git a/pg17/Dockerfile-timescaledb b/pg17/Dockerfile-timescaledb index cab1672..b0a8922 100644 --- a/pg17/Dockerfile-timescaledb +++ b/pg17/Dockerfile-timescaledb @@ -1,4 +1,4 @@ -ARG PG_VERSION=17.6 +ARG PG_VERSION=17.7 ARG PG_MAJOR_VERSION=17 ARG VERSION=custom From 12722879c213f5a6418c145cbff19eeeb6432ae7 Mon Sep 17 00:00:00 2001 From: Sergio Moreno Date: Mon, 5 Jan 2026 18:32:54 +0100 Subject: [PATCH 7/7] chore: revert back to 2.8 haproxy --- pg15/Dockerfile | 2 +- pg15/Dockerfile-timescaledb | 2 +- pg16/Dockerfile | 2 +- pg16/Dockerfile-timescaledb | 2 +- pg17/Dockerfile | 2 +- pg17/Dockerfile-timescaledb | 2 +- pg18/Dockerfile | 4 +++- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pg15/Dockerfile b/pg15/Dockerfile index c5bbb4c..1358484 100644 --- a/pg15/Dockerfile +++ b/pg15/Dockerfile @@ -28,7 +28,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=3.3 +ARG HAPROXY_VERSION=2.8 LABEL fly.app_role=postgres_cluster LABEL fly.version=${VERSION} diff --git a/pg15/Dockerfile-timescaledb b/pg15/Dockerfile-timescaledb index 1f5502f..8610fb1 100644 --- a/pg15/Dockerfile-timescaledb +++ b/pg15/Dockerfile-timescaledb @@ -29,7 +29,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=3.3 +ARG HAPROXY_VERSION=2.8 LABEL fly.app_role=postgres_cluster LABEL fly.version=${VERSION} diff --git a/pg16/Dockerfile b/pg16/Dockerfile index 43a95ab..ad8fbd4 100644 --- a/pg16/Dockerfile +++ b/pg16/Dockerfile @@ -25,7 +25,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=3.3 +ARG HAPROXY_VERSION=2.8 ARG REPMGR_VERSION=5.4.1-1build2 ENV PGDATA=/data/postgresql diff --git a/pg16/Dockerfile-timescaledb b/pg16/Dockerfile-timescaledb index cd088c0..ac37841 100644 --- a/pg16/Dockerfile-timescaledb +++ b/pg16/Dockerfile-timescaledb @@ -25,7 +25,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=3.3 +ARG HAPROXY_VERSION=2.8 ARG REPMGR_VERSION=5.4.1-1build2 ENV PGDATA=/data/postgresql diff --git a/pg17/Dockerfile b/pg17/Dockerfile index d78b25f..7569f65 100644 --- a/pg17/Dockerfile +++ b/pg17/Dockerfile @@ -25,7 +25,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=3.3 +ARG HAPROXY_VERSION=2.8 ARG REPMGR_VERSION=5.5.0+debpgdg-3.pgdg24.04+1 ENV PGDATA=/data/postgresql diff --git a/pg17/Dockerfile-timescaledb b/pg17/Dockerfile-timescaledb index b0a8922..4124ca9 100644 --- a/pg17/Dockerfile-timescaledb +++ b/pg17/Dockerfile-timescaledb @@ -25,7 +25,7 @@ ARG VERSION ARG PG_MAJOR_VERSION ARG PG_VERSION ARG POSTGIS_MAJOR=3 -ARG HAPROXY_VERSION=3.3 +ARG HAPROXY_VERSION=2.8 ARG REPMGR_VERSION=5.5.0+debpgdg-3.pgdg24.04+1 ENV PGDATA=/data/postgresql diff --git a/pg18/Dockerfile b/pg18/Dockerfile index 96d25fb..e48f92b 100644 --- a/pg18/Dockerfile +++ b/pg18/Dockerfile @@ -74,7 +74,9 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ postgresql-${PG_MAJOR_VERSION}-postgis-$POSTGIS_MAJOR-scripts # Haproxy -RUN apt-get update && apt-get install --no-install-recommends -y \ +RUN apt-get update && apt-get install --no-install-recommends -y software-properties-common && \ + add-apt-repository ppa:vbernat/haproxy-${HAPROXY_VERSION} && \ + apt-get update && apt-get install --no-install-recommends -y \ haproxy=$HAPROXY_VERSION.\* \ && apt autoremove -y && apt clean