Skip to content

[examples / demo] Examples/demo Docker configuration #1253

Description

@andyatkinson

I have found when running Postgres 18+ in Docker the PGDATA directory has changed to include a major version in it. For example when I cd examples/demo and run docker compose up now, Postgres 18 has its volume and PGDATA configured with /var/lib/postgresql/data which produces the following error when starting up:

Error: 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

When I change it to /var/lib/postgresql then docker compose up works as expected.

--- a/examples/demo/docker-compose.yml
+++ b/examples/demo/docker-compose.yml
@@ -6,7 +6,7 @@ services:
     ports:
       - 6000:5432
     volumes:
-      - shard_0:/var/lib/postgresql/data
+      - shard_0:/var/lib/postgresql

Is the example at examples/demo supported? Do you want a small PR with the above change in each spot?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions