Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't start container with existing volume. #440

Open
webpalych opened this issue Aug 11, 2023 · 3 comments
Open

Can't start container with existing volume. #440

webpalych opened this issue Aug 11, 2023 · 3 comments

Comments

@webpalych
Copy link

What is the bug or the crash?

I updated my application and needed to rebuild images, so I restarted my docker-compose and postgis container no longer starts. In container logs I see an error "ERROR: must be superuser to alter superuser roles or change superuser attribute". If i don't use volume or use new empty volume, container starts.

Fragment of my docker-compose.yml

my-app.db:
    image: kartoza/postgis:14-3.3
    restart: always
    environment:
      POSTGRES_PASSWORD: $DB_PASSWORD
      POSTGRES_USER: $DB_USER
      POSTGRES_DB: $DB_NAME
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}" ]
      interval: 5s
      timeout: 5s
      retries: 5
    ports:
      - '5433:5432'
    volumes:
     - ./postgres-data:/var/lib/postgresql/14

Steps to reproduce the issue

_

Versions

kartoza/postgis:14-3.3

Additional context

No response

@NyakudyaA
Copy link
Collaborator

Can you try changing permission for your data directory before running postgres.

@webpalych
Copy link
Author

Wich permission directory should have?
Docker created directory postgres-data
drwxr-xr-x 3 root root 4096 postgres-data
postgres-data/main
drwxr-x--- 19 systemd-network systemd-network 4096 main

@NyakudyaA
Copy link
Collaborator

I suggest you check out the option to run the image as none root https://github.com/kartoza/docker-postgis#rootless-mode

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

No branches or pull requests

2 participants