1 FROM debian:stretch-slim
2 LABEL maintainer="feedback@check-mk.org"
4 # Pure build time variable declarations (docker build --build-arg KEY=val)
5 ARG CMK_VERSION="1.6.0i1"
6 # Choose one of: raw, enterprise, managed
9 ARG CMK_DL_URL="https://mathias-kettner.de/support"
10 # Give download credentials in "USER:PASSWORD" format. You can only use Raw Edition without
11 ARG CMK_DL_CREDENTIALS=""
13 # The following variables can be set during container init (docker run -e KEY=val)
16 # Set this to "on" to enable livestatus via network
17 ARG CMK_LIVESTATUS_TCP
18 ENV CMK_LIVESTATUS_TCP=""
19 # A random password will be generated in case you don't set this
23 # Specify the FQDN of your relay mail server to sent mails to
25 ENV MAIL_RELAY_HOST=""
27 # Make the list of required packages available to the following command
28 COPY needed-packages /needed-packages
30 # First install the tools we need for fetching the package and installation
31 # Then fetch the package and install it. This will make sure all Check_MK
32 # containers will share all dependencies, including this step.
33 # hadolint ignore=SC2046,DL3008
35 && echo "exit 101" > /usr/sbin/policy-rc.d \
36 && chmod +x /usr/sbin/policy-rc.d \
37 && export DEBIAN_FRONTEND=noninteractive \
39 && apt-get install -y --no-install-recommends \
48 $(cat needed-packages) \
50 && rm /usr/sbin/policy-rc.d \
51 && rm -rf /var/lib/apt/lists/* \
55 # Optionally copy an existing Check_MK debian package to the container. In case the file is
56 # available that is later used by the build procedure the file will not be downloaded.
57 COPY check-mk-${CMK_EDITION}-${CMK_VERSION}_0.stretch_*.deb Check_MK-pubkey*gpg needed-packages /
59 # Now install the Check_MK version specific things
60 # hadolint ignore=DL3003,DL3008,DL4006
62 && mkdir -p /usr/share/man/man8 \
63 && echo "exit 101" > /usr/sbin/policy-rc.d \
64 && chmod +x /usr/sbin/policy-rc.d \
65 && export DEBIAN_FRONTEND=noninteractive \
66 && PKG_NAME="check-mk-${CMK_EDITION}-${CMK_VERSION}" \
67 && PKG_FILE="${PKG_NAME}_0.stretch_$(dpkg --print-architecture).deb" \
68 && if [ ! -e "/${PKG_FILE}" ]; then \
69 echo "Downloading ${PKG_FILE}..." && \
70 echo "--user \"${CMK_DL_CREDENTIALS}\"" \
71 | curl -o "${PKG_FILE}" -K - "${CMK_DL_URL}/${CMK_VERSION}/${PKG_FILE}" ; \
73 && if [ ! -e "/Check_MK-pubkey.gpg" ]; then \
74 echo "Downloading Check_MK-pubkey.gpg..." && \
75 curl -sS "${CMK_DL_URL}/Check_MK-pubkey.gpg" \
78 gpg -q --import "/Check_MK-pubkey.gpg" ; \
80 && dpkg-sig --verify "${PKG_FILE}" \
81 && dpkg -i "${PKG_FILE}" \
82 && rm -f -- *.deb *.gpg needed-packages \
84 && rm /usr/sbin/policy-rc.d \
85 && rm -rf /var/lib/apt/lists/*
88 org.opencontainers.image.title="Check_MK" \
89 org.opencontainers.image.version="${CMK_VERSION}" \
90 org.opencontainers.image.description="Check_MK is a leading tool for Infrastructure & Application Monitoring" \
91 org.opencontainers.image.vendor="Mathias Kettner GmbH" \
92 org.opencontainers.image.source="https://git.mathias-kettner.de/" \
93 org.opencontainers.image.url="https://mathias-kettner.com/"
96 # 5000 - Serves the Check_MK GUI
97 # 6557 - Serves Livestatus (if enabled via "omd config")
100 # When all processes of the site are running everything should be fine
101 HEALTHCHECK --interval=1m --timeout=5s \
102 CMD omd status || exit 1
104 COPY docker-entrypoint.sh /
105 # Starts the entrypoint script and hands over CMD by default
106 ENTRYPOINT ["/docker-entrypoint.sh"]