[GH-ISSUE #154] Volume bind mount path changed with postgres v18 #126

Open
opened 2026-02-26 21:34:32 +03:00 by kerem · 0 comments
Owner

Originally created by @tobi-dub on GitHub (Nov 14, 2025).
Original GitHub issue: https://github.com/eduardolat/pgbackweb/issues/154

When setting up a complete new pgbackweb stack with your provided compose example, I get the following error:

$ docker compose up 
[+] Running 3/3
 ✔ Network pgbackweb_default  Created                                                                                                                                          0.1s 
 ✔ Container postgres         Created                                                                                                                                          0.1s 
 ✔ Container pgbackweb        Created                                                                                                                                          0.0s 
Attaching to pgbackweb, postgres
postgres  | Error: in 18+, these Docker images are configured to store database data in a
postgres  |        format which is compatible with "pg_ctlcluster" (specifically, using
postgres  |        major-version-specific directory names).  This better reflects how
postgres  |        PostgreSQL itself works, and how upgrades are to be performed.
postgres  | 
postgres  |        See also https://github.com/docker-library/postgres/pull/1259
postgres  | 
postgres  |        Counter to that, there appears to be PostgreSQL data in:
postgres  |          /var/lib/postgresql/data (unused mount/volume)
postgres  | 
postgres  |        This is usually the result of upgrading the Docker image without
postgres  |        upgrading the underlying database using "pg_upgrade" (which requires both
postgres  |        versions).
postgres  | 
postgres  |        The suggested container configuration for 18+ is to place a single mount
postgres  |        at /var/lib/postgresql which will then place PostgreSQL data in a
postgres  |        subdirectory, allowing usage of "pg_upgrade --link" without mount point
postgres  |        boundary issues.
postgres  | 
postgres  |        See https://github.com/docker-library/postgres/issues/37 for a (long)
postgres  |        discussion around this process, and suggestions for how to do so.
postgres exited with code 1
dependency failed to start: container postgres exited (1)

In your example compose file with postgres v18, the volume bind mount path in the container is wrong. With postgres v18, it changed from /var/lib/postgresql/data to /var/lib/postgresql.

After changing it, the database starts successfully.

$ docker compose up
[...]
pgbackweb-db  | 2025-11-14 20:54:42.081 UTC [1] LOG:  database system is ready to accept connections
Originally created by @tobi-dub on GitHub (Nov 14, 2025). Original GitHub issue: https://github.com/eduardolat/pgbackweb/issues/154 When setting up a complete new pgbackweb stack with your provided compose example, I get the following error: ``` $ docker compose up [+] Running 3/3 ✔ Network pgbackweb_default Created 0.1s ✔ Container postgres Created 0.1s ✔ Container pgbackweb Created 0.0s Attaching to pgbackweb, postgres postgres | Error: in 18+, these Docker images are configured to store database data in a postgres | format which is compatible with "pg_ctlcluster" (specifically, using postgres | major-version-specific directory names). This better reflects how postgres | PostgreSQL itself works, and how upgrades are to be performed. postgres | postgres | See also https://github.com/docker-library/postgres/pull/1259 postgres | postgres | Counter to that, there appears to be PostgreSQL data in: postgres | /var/lib/postgresql/data (unused mount/volume) postgres | postgres | This is usually the result of upgrading the Docker image without postgres | upgrading the underlying database using "pg_upgrade" (which requires both postgres | versions). postgres | postgres | The suggested container configuration for 18+ is to place a single mount postgres | at /var/lib/postgresql which will then place PostgreSQL data in a postgres | subdirectory, allowing usage of "pg_upgrade --link" without mount point postgres | boundary issues. postgres | postgres | See https://github.com/docker-library/postgres/issues/37 for a (long) postgres | discussion around this process, and suggestions for how to do so. postgres exited with code 1 dependency failed to start: container postgres exited (1) ``` In your example compose file with postgres v18, the volume bind mount path in the container is wrong. With postgres v18, it changed from `/var/lib/postgresql/data` to `/var/lib/postgresql`. After changing it, the database starts successfully. ``` $ docker compose up [...] pgbackweb-db | 2025-11-14 20:54:42.081 UTC [1] LOG: database system is ready to accept connections ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pgbackweb#126
No description provided.