1 Commits

Author SHA1 Message Date
2e4dfe89b7 Created an Alpine-version 2020-04-28 20:37:32 +02:00
3 changed files with 8 additions and 30 deletions

View File

@@ -1,11 +1,10 @@
FROM ubuntu:18.04 FROM alpine:3.11
RUN apt-get update && apt-get upgrade -y && apt-get install wget gnupg expect -y && \ RUN apk update && \
wget -O - https://packages.icinga.com/icinga.key | apt-key add - apk add bash && \
RUN printf "deb http://packages.icinga.com/ubuntu icinga-bionic main\ndeb-src http://packages.icinga.com/ubuntu icinga-bionic main" > /etc/apt/sources.list.d/icinga2.list && \ apk add icinga2 && \
apt-get update && apt-get install icinga2 -y && \ mkdir /run/icinga2 && chown icinga:icinga /run/icinga2 && \
mkdir /run/icinga2 && chown nagios:nagios /run/icinga2 && \
mkdir -p /var/lib/icinga2/certs && \ mkdir -p /var/lib/icinga2/certs && \
chown -R nagios:nagios /var/lib/icinga2/certs chown -R icinga:icinga /var/lib/icinga2/certs
COPY create-satellite.sh /create-satellite.sh COPY create-satellite.sh /create-satellite.sh
COPY run-icinga.sh /run-icinga.sh COPY run-icinga.sh /run-icinga.sh

View File

@@ -17,18 +17,15 @@ Everything is controlled using the follwing environment variables.
* **TICKET** is the ticket you get from the master (if you are using Director * **TICKET** is the ticket you get from the master (if you are using Director
you find it under the Agent tab of the host). you find it under the Agent tab of the host).
* **ACCEPT_CONFIG** takes a ***y*** or ***n*** value for yes or no. The default is * **ACCEPT_CONFIG** takes a ***y*** or ***n*** value for yes or no. The default is
***n*** ***n***.
* **ACCEPT_COMMANDS** takes a ***y*** or ***n*** value for yes or no. The default is * **ACCEPT_COMMANDS** takes a ***y*** or ***n*** value for yes or no. The default is
***n*** ***n***.
* **DISABLE_CONFD** takes a ***y*** or ***n*** value for yes or no. The default is * **DISABLE_CONFD** takes a ***y*** or ***n*** value for yes or no. The default is
***y***. This should be a sane default for most people. ***y***. This should be a sane default for most people.
* **LOCAL_TIMEZONE** sets the local timezone of the satellite. For example
*Europe/Stockholm* or *America/New_York*
## Example usage ## Example usage
``` ```
#> docker run -d --name my-icinga-sat \ #> docker run -d --name my-icinga-sat \
-p 5665:5665 \
-e CN=icinga-sat02.local \ -e CN=icinga-sat02.local \
-e PARENTHOST=icinga-master.local \ -e PARENTHOST=icinga-master.local \
-e PARENTCN=icinga-master.local \ -e PARENTCN=icinga-master.local \
@@ -44,9 +41,6 @@ version: "3.8"
services: services:
my-icinga-sat: my-icinga-sat:
image: jackbenny/icinga-satellite image: jackbenny/icinga-satellite
ports:
- 5665:5665
restart:always
environment: environment:
- CN=icinga-sat02.local - CN=icinga-sat02.local
- ZONE=icinga-sat02.local - ZONE=icinga-sat02.local
@@ -57,15 +51,5 @@ services:
- ACCEPT_CONFIG=y - ACCEPT_CONFIG=y
- ACCEPT_COMMANDS=y - ACCEPT_COMMANDS=y
- DISABLE_CONFD=y - DISABLE_CONFD=y
- LOCAL_TIMEZONE=Europe/Stockholm
``` ```
## Images
> **NOTE:** Currently there are some problems with the Alpine image. Use the main image
> instead, tagged *0.n*.
There are two available images for you to choose from. The default one (0.*n*) is based on
Ubuntu 18.04, with Icinga2 from Icingas official repository. The other image (0.*n*-alpine) is
based on Alpine 3.11, with Icinga2 from Alpines repository. From 0.1.1-alpine and up, the Alpine
image is built on the latest Alpine. The Alpine image is much smaller in size.

View File

@@ -37,11 +37,6 @@ else
DISABLE_CONF=" " DISABLE_CONF=" "
fi fi
# Set the local timezone
if [ ! -z "$LOCAL_TIMEZONE" ]; then
ln -sf /usr/share/zoneinfo/"$LOCAL_TIMEZONE" /etc/localtime
fi
icinga2 pki new-cert --cn "$CN" \ icinga2 pki new-cert --cn "$CN" \
--key /var/lib/icinga2/certs/"${CN}".key \ --key /var/lib/icinga2/certs/"${CN}".key \
--cert /var/lib/icinga2/certs/"${CN}".crt --cert /var/lib/icinga2/certs/"${CN}".crt