Skip to content

Bump 17 image to 17.11, add a Postgres 18 image and a 17-to-18 upgrade job image - #9

Merged
alandotcom merged 4 commits into
mainfrom
claude/practical-hamilton-ekih7w
Nov 20, 2026
Merged

alandotcom merged 4 commits into
mainfrom
claude/practical-hamilton-ekih7w

Conversation

@alandotcom

@alandotcom alandotcom commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Dockerfile-17 moves its base from postgres-ssl:17.10 to 17.11, the newest 17.x tag in ghcr.io/railwayapp-templates/postgres-ssl.
  • New Dockerfile-18 builds from postgres-ssl:18.6 (the newest 18.x tag) and installs postgresql-18-cron. It follows the same structure and header as the 17 image.
  • New Dockerfile-upgrade-17-18 builds a one-shot job image that upgrades a 17 data directory to 18 in place. It starts from Railway's own upgrade job image, ghcr.io/railwayapp-templates/postgres-ssl/upgrade:17-18 (pinned by digest), and adds postgresql-17-cron and postgresql-18-cron. The Dockerfile header has the per-service runbook.
  • .github/workflows/build.yml runs a matrix over 17, 18 and upgrade-17-18. Each entry builds Dockerfile-<image> and publishes ghcr.io/fountain-bio/postgres:<image> and :<image>-<sha>. The job name stays postgres-<image>, so the existing postgres-17 check keeps its name. fail-fast: false keeps one image's failure from cancelling the other publishes.
  • .github/dependabot.yml ignores semver-major bumps of railwayapp-templates/postgres-ssl. This prevents a repeat of the reverted 17.10 to 18.6 PR, because a major bump would point the 17 tag at a server that cannot read existing 17 data directories.
  • The Dockerfile headers no longer reference private repositories.

Why a separate upgrade image

Railway's one-click major upgrade (Database > Config > Major Version Upgrade) runs only for services on Railway's official postgres-ssl image. Railway's upgrade docs state that custom images are not supported, and services built from this repo run ghcr.io/fountain-bio/postgres:17. Railway's job image also lacks pg_cron. Volumes running these images preload pg_cron, so in Railway's stock image the 17 server cannot start, and pg_upgrade's loadable-libraries check would fail on the 18 side. Adding pg_cron for both majors fixes both problems. upgrade-job.sh copies the old cluster's shared_preload_libraries onto the 18 server, and pg_cron returns early from its init under IsBinaryUpgrade, so its scheduler stays off while pg_upgrade runs.

The upgrade job requires the volume mounted at /var/lib/postgresql/data, which is the mount path Railway's 17 template creates.

Server minor versions

PGDG builds each pg_cron package against the newest server minor and depends on it. Installing pg_cron therefore raises the bundled server past the base tag's minor: the 17 image runs 17.12 on the 17.11 base, and the 18 image runs 18.7 on the 18.6 base. The 17 image already did this before this PR. The upgrade image takes the same raise, so the 18 binaries that create the new cluster match the 18 runtime image.

Rollout notes

  • Merging publishes images and deploys nothing. Railway services pick up the new 17 image on their next redeploy.
  • Changing a service's Source Image from :17 to :18 alone does not migrate the data. Follow the runbook in Dockerfile-upgrade-17-18, which runs check, then upgrade, then switches the service to :18.

Verification

The pull request CI run builds all three images without publishing, and all three pass. The upgrade image has not been run against a real volume yet. Test it on a copy of a database restored from a backup before using it on a live service.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lhd3gW9wt3QAv5fiZut9ko

Dockerfile-17 moves its base from postgres-ssl:17.10 to 17.11, the newest
17.x tag Railway publishes. Dockerfile-18 builds from postgres-ssl:18.6
with postgresql-18-cron, mirroring the 17 image.

The build workflow becomes a matrix over majors 17 and 18, publishing
ghcr.io/fountain-bio/postgres:<major> and :<major>-<sha> from
Dockerfile-<major>. Job names stay postgres-<major>, so the existing
postgres-17 check name is unchanged.

Dependabot now ignores semver-major bumps of the postgres-ssl base, which
is the 17.10 -> 18.6 PR that had to be reverted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lhd3gW9wt3QAv5fiZut9ko
Railway's dashboard major upgrade only runs for services on Railway's own
postgres-ssl image, so services on ghcr.io/fountain-bio/postgres cannot
use it. Dockerfile-upgrade-17-18 extends the job image that flow runs,
ghcr.io/railwayapp-templates/postgres-ssl/upgrade:17-18 (pinned by
digest), with pg_cron for both majors. Without postgresql-17-cron the
old server cannot start, because our volumes preload pg_cron, and
without postgresql-18-cron pg_upgrade's loadable-libraries check fails.

The build matrix publishes it as ghcr.io/fountain-bio/postgres:upgrade-17-18.
The Dockerfile header carries the per-service runbook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lhd3gW9wt3QAv5fiZut9ko
@alandotcom alandotcom changed the title Bump 17 image to 17.11 and add a Postgres 18 image Bump 17 image to 17.11, add a Postgres 18 image and a 17-to-18 upgrade job image Nov 20, 2026
The upgrade image build failed because PGDG's current pg_cron packages
depend on postgresql-17 > 17.12 and postgresql-18 > 18.7, while the
apt-mark hold kept the base image's 17.11 and 18.6. The runtime images
already take that raise from their own pg_cron install (the 17 build
moves postgresql-17 from 17.11 to 17.12), so drop the hold and let the
upgrade image do the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lhd3gW9wt3QAv5fiZut9ko
@alandotcom
alandotcom merged commit 9db9624 into main Nov 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants