We use cookies to ensure that we give you the best experience on our website. Visit our Privacy Policy to learn more. If you continue to use this site, we will assume that you are okay with it.

Your choices regarding cookies on this site.
Your preferences have been updated.
In order for the changes to take effect completely please clear your browser cookies and cache. Then reload the page.

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

Componentdistros
TitleDocker container: Add hook functions to docker entrypoint
Date2019-08-01 16:48:13
Checkmk EditionCheckmk Raw Edition (CRE)
Checkmk Version1.7.0i1
LevelTrivial Change
ClassNew Feature
CompatibilityCompatible - 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