Skip to content

Commit 1feec50

Browse files
authored
Remove /data from postgres volume path (#369)
Currently PG container fails to start with a long message: " in 18+, these Docker images are configured to store database data in a format which is compatible with "pg_ctlcluster" (specifically, using major-version-specific directory names). This better reflects how PostgreSQL itself works, and how upgrades are to be performed. See also https://github.com/docker-library/postgres/pull/1259⁠ Counter to that, there appears to be PostgreSQL data in: /var/lib/postgresql/data (unused mount/volume) This is usually the result of upgrading the Docker image without upgrading the underlying database using "pg_upgrade" (which requires both versions). The suggested container configuration for 18+ is to place a single mount at /var/lib/postgresql which will then place PostgreSQL data in a subdirectory, allowing usage of "pg_upgrade --link" without mount point boundary issues. See https://github.com/docker-library/postgres/issues/37⁠ for a (long) discussion around this process, and suggestions for how to do so. " According to that, you should have "a single mount at /var/lib/postgresql", so this is that change Tested on a local single container of postgres:latest, works
1 parent 11dad0f commit 1feec50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/postgres/.devcontainer/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222
image: postgres:latest
2323
restart: unless-stopped
2424
volumes:
25-
- postgres-data:/var/lib/postgresql/data
25+
- postgres-data:/var/lib/postgresql
2626
environment:
2727
POSTGRES_USER: postgres
2828
POSTGRES_DB: postgres

0 commit comments

Comments
 (0)