Skip to content

Fix PostgreSQL 18 Docker volume compatibility - #776

Open
Lalit-Kumar-Badhotiya wants to merge 1 commit into
code100x:mainfrom
Lalit-Kumar-Badhotiya:fix/postgres-18-docker-volume
Open

Fix PostgreSQL 18 Docker volume compatibility#776
Lalit-Kumar-Badhotiya wants to merge 1 commit into
code100x:mainfrom
Lalit-Kumar-Badhotiya:fix/postgres-18-docker-volume

Conversation

@Lalit-Kumar-Badhotiya

@Lalit-Kumar-Badhotiya Lalit-Kumar-Badhotiya commented Aug 11, 2026

Copy link
Copy Markdown

Bug Fixes:

Checklist before requesting a review

  • [ yes] I have performed a self-review of my code
  • [ yes] I assure there is no similar/duplicate pull request regarding same issue

Problem

The project currently uses postgres:alpine with the PostgreSQL data
volume mounted at /var/lib/postgresql/data.

The postgres:alpine image now resolves to PostgreSQL 18, which uses
a different data directory layout. As a result, the database container
fails to start with:

there appears to be PostgreSQL data in /var/lib/postgresql/data

Fix

Update the PostgreSQL volume mount from:

/var/lib/postgresql/data

to:

/var/lib/postgresql

This follows the volume layout expected by the PostgreSQL 18 Docker image.

Question:
How this bug happened?

  • we are using image: postgres:alpine
  • postgres:alpine is now resolving to a PostgreSQL 18+ image.
  • and PostgreSQL 18's Docker image changed the recommended data directory layout. The new image expects the volume mounted at:
  • form /var/lib/postgresql/data to /var/lib/postgresql
  • The PostgreSQL image is explicitly detecting our old mount and refusing to start.
  • this new fix will work for postgresql 18 and +

##Before fix
Screenshot 2026-08-11 144253

##After fix

Screenshot 2026-08-11 145144

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.

1 participant