Pin PGDATA so postgres:18 works with legacy volume mount#777
Merged
Conversation
`postgres:18` changed its default `PGDATA` from `/var/lib/postgresql/data` to `/var/lib/postgresql/$PG_MAJOR/docker` (docker-library/postgres#1259). The entrypoint now probes for a mount at the legacy path and exits with `unused mount/volume` even on a fresh volume, which breaks `docker compose up` for new developer machines and CI runs that include this compose file. Set `PGDATA=/var/lib/postgresql/data` explicitly on the postgres service in both `docker-compose.yaml` and `docker-compose.smoke-test.yaml`. This overrides the new default so the existing volume layout keeps working without rewriting the mount path. Fixes #773
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #777 +/- ##
=======================================
Coverage 61.07% 61.07%
=======================================
Files 108 108
Lines 10593 10593
=======================================
Hits 6470 6470
Misses 3546 3546
Partials 577 577 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
amirejaz
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
postgres:18changed its defaultPGDATAto/var/lib/postgresql/$PG_MAJOR/docker(ChangePGDATAin 18+ to/var/lib/postgresql/MAJOR/dockerdocker-library/postgres#1259). The entrypoint now refuses to start when it sees a mount at the legacy/var/lib/postgresql/datapath — even on a fresh volume — exiting withunused mount/volume.PGDATA=/var/lib/postgresql/dataexplicitly on the postgres service in bothdocker-compose.yamlanddocker-compose.smoke-test.yamlso the existing volume layout keeps working.Why this minimal override
Upstream's recommended config for 18+ is to mount at
/var/lib/postgresql(parent dir) sopg_upgrade --linkworks without crossing mount boundaries. That's a bigger change to the volume layout and would lose existing data on upgrade. PinningPGDATAis the smallest diff that unbreaksdocker compose uptoday; the parent-mount migration can be a follow-up if/when major-version upgrades are on the table.Test plan
docker compose down -v && docker compose upfrom a clean state — postgres reacheshealthy,registry-apiruns migrations and serves on:8080.docker compose -f docker-compose.smoke-test.yaml --project-name thv-smoke-test up --detach --waitsucceeds (or run thesmoke-testskill end-to-end).Fixes #773
🤖 Generated with Claude Code