Skip to content

How to execute docker-entrypoint.sh with a different user as root within docker swarm? #350

Closed
@fentas

Description

@fentas

This pull #289 broke my setup completely. As a quick fix, I had to build an image with a version of docker-enytrypoint.sh before this pull.

I am using Postgres within my docker swarm setup (docker-compose stack deploy). Before this pull, I just added init DB scripts into /docker-entrypoint-initdb.d/ and all worked fine. But now docker-enytrypoint.sh will never come to this point because the entry point is executed as root user which will terminate it at line 40. Additionally $PGDATA/pg_hba.conf is never configured, which was before.

Is there a way to tackle this? I tried

  • to set user: postgres
  • to create a custom entrypoint and executed /docker-entrypoint.sh with postgres user
  • to create a custom Dockerfile and set USER postgres

All failed in some way. :/ Thanks a lot!

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