Skip to content

In v18 start up error: mkdir: can't create directory #1380

@kibblewhite

Description

@kibblewhite

On v17 I notice this:

fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... ok

On v18, I just get this:

mkdir: can't create directory '/var/lib/postgresql/data/': Permission denied

Obviously, I can go in and manually fix it, or write another script to fix another issue, but it would be nice if it worked just like it did in v17.
What's your opinion on this? Intentional, or has it been forgotten about?

I did search for this:
https://github.com/docker-library/postgres/issues?q=mkdir%3A%20can%27t%20create%20directory

But nothing came up.

To reproduce, here is the compose I'm using, change 17-alpine to 18-alpine and the errors occurs.

services:
  alerts.db.internal.local:
    container_name: alerts.db.internal.local
    hostname: alerts.db.internal.local
    image: postgres:17-alpine
    environment:
      - PGDATA=/var/lib/postgresql/data/pgdata
      - POSTGRES_PASSWORD=development-password
      - POSTGRES_USER=postgres
      - POSTGRES_DB=alerts.svc
      - LANG=und-x-icu
      - PGTZ=UTC
      - PGPORT=44432
    restart: unless-stopped
    expose:
      - 44432
    ports:
      - 44432:44432
    volumes:
      - ecs-alerts-db-data-vol:/var/lib/postgresql/data

volumes:
  ecs-alerts-db-data-vol:
    name: ecs-alerts-db-data-vol

To start it up: docker compose -p ecs-alerts-stack -f docker-compose.yml up -d

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