Werk #8857: Docker container: Add hook functions to docker entrypoint

Component Linux distributions
Title Docker container: Add hook functions to docker entrypoint
Date Aug 1, 2019
Checkmk Edition Checkmk Raw (CRE)
Checkmk Version 2.0.0i1
Level Trivial Change
Class New Feature
Compatibility Compatible - no manual interaction needed

With this change it is possible to to execute custom hook scripts during the container startup. This is useful in case you want to integrate your own logic into containers based on the Checkmk images.

These hooks have been created:

pre-create - Is executed on the very first container startup before the Checkmk site in the container is created with "omd create". post-create - Is executed after site has been created and internal "omd config" is done. pre-update - Is executed after a volume has been moved to a container basing on an image with another Checkmk version. Is called before "omd update" is executed. post-update - Is executed after a volume has been moved to a container basing on an image with another Checkmk version. Is called after "omd update" was executed. pre-start - Is executed each time when the container is started before "omd start" post-start - Is executed each time when the container is started after "omd start"

To use them you need to either mount the scripts into your container or create a custom image based on our container images. Your scripts need to be located in one of the below directories and need to be executable.

docker-entrypoint.d/
|-- post-create
|   |-- 01_foo.sh
|   |-- 02_bar.sh
|   `-- 03_baz.sh
|-- post-update
|   |-- 01_foo.sh
|   |-- 02_bar.sh
|   `-- 03_baz.sh
|-- post-start
|   |-- 01_foo.sh
|   |-- 02_bar.sh
|   `-- 03_baz.sh
|-- pre-create
|   |-- 01_foo.sh
|   |-- 02_bar.sh
|   `-- 03_baz.sh
|-- pre-update
|   |-- 01_foo.sh
|   |-- 02_bar.sh
|   `-- 03_baz.sh
`-- pre-start
    |-- 01_foo.sh
    |-- 02_bar.sh
    `-- 03_baz.sh

To the list of all Werks