Skip to content

Commit

Permalink
Add new "docker-ensure-initdb.sh" script
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
tianon committed Dec 11, 2023
1 parent d8c3360 commit c86568a
Show file tree
Hide file tree
Showing 66 changed files with 1,562 additions and 27 deletions.
7 changes: 4 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*/**/Dockerfile linguist-generated
/*/**/docker-entrypoint.sh linguist-generated
/Dockerfile*.template linguist-language=Dockerfile
/*/**/Dockerfile linguist-generated
/*/**/docker-ensure-initdb.sh linguist-generated
/*/**/docker-entrypoint.sh linguist-generated
/Dockerfile*.template linguist-language=Dockerfile
3 changes: 2 additions & 1 deletion 12/alpine3.18/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions 12/alpine3.18/docker-ensure-initdb.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions 12/alpine3.18/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 12/alpine3.19/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions 12/alpine3.19/docker-ensure-initdb.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions 12/alpine3.19/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 12/bookworm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions 12/bookworm/docker-ensure-initdb.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions 12/bookworm/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 12/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions 12/bullseye/docker-ensure-initdb.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions 12/bullseye/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 13/alpine3.18/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c86568a

Please sign in to comment.