Skip to content

Add hook to execute scripts before startup, and allow them to add arguments to the startup #591

Closed
@thijslemmens

Description

@thijslemmens

I would like to be able to hook in just before PostgreSQL starts and add my own script there.
I would use it to add a script that reads environment variables that start with PGCONF_ and add them to the startup parameters.
example:
docker run -e PGCONF_log_checkpoints=on postgres

This would start postgres with argument log_checkpoints=on

I already use this for a while, but I needed to do some sed in the init script to make it possible. I would be happy to contribute a PR, but I want to make sure this is something that can be accepted.
I replaced the last line with this script:
https://github.com/xenit-eu/docker-postgres/blob/master/src/main/docker/before-startup.sh
Our images are published on docker hub:
xeniteu/postgres

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