1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-11-10 04:42:21 +03:00
Commit Graph

2 Commits

Author SHA1 Message Date
Tianon Gravi
2c6fe8daca Add logic to error out on detection of "old databases" 2025-06-06 11:27:47 -07:00
Tianon Gravi
c86568af4a Add new "docker-ensure-initdb.sh" script
This mimics the behavior of `docker-entrypoint.sh` before it starts the PostgreSQL server.

It has three main goals/uses:

  1. (most importantly) as an example of how to use "docker-entrypoint.sh" to extend/reuse the initialization behavior

  2. ("docker-ensure-initdb.sh") as a Kubernetes "init container" to ensure the provided database directory is initialized; see also "startup probes" for an alternative solution
       (no-op if database is already initialized)

  3. ("docker-enforce-initdb.sh") as part of CI to ensure the database is fully initialized before use
       (error if database is already initialized)
2023-12-11 10:58:54 -08:00