Refactoring to follow some best practices
This commit is contained in:
parent
6a64f09ea5
commit
9d8443680f
11
Dockerfile
11
Dockerfile
@ -1,14 +1,17 @@
|
|||||||
FROM ubuntu:18.04
|
FROM ubuntu:18.04
|
||||||
RUN apt-get update && apt-get upgrade -y && apt-get install wget gnupg expect -y && \
|
RUN apt-get update && apt-get install wget gnupg -y && \
|
||||||
wget -O - https://packages.icinga.com/icinga.key | apt-key add -
|
wget -O - https://packages.icinga.com/icinga.key | apt-key add -
|
||||||
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 && \
|
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 && \
|
||||||
apt-get update && apt-get install icinga2 -y && \
|
apt-get update && apt-get --no-install-recommends install icinga2 monitoring-plugins tzdata -y && \
|
||||||
mkdir /run/icinga2 && chown nagios:nagios /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 nagios:nagios /var/lib/icinga2/certs && \
|
||||||
|
apt-get remove -y wget gnupg && \
|
||||||
|
apt-get autoremove -y && \
|
||||||
|
apt-get clean
|
||||||
|
|
||||||
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
|
||||||
RUN chmod +x /create-satellite.sh ; chmod +x /run-icinga.sh
|
RUN chmod +x /create-satellite.sh ; chmod +x /run-icinga.sh
|
||||||
|
EXPOSE 5665
|
||||||
ENTRYPOINT ["/run-icinga.sh"]
|
ENTRYPOINT ["/run-icinga.sh"]
|
||||||
|
29
README.md
29
README.md
@ -3,8 +3,27 @@ An easy-to-use Dockerized Icinga2 satellite setup. It could be used as an
|
|||||||
Icinga2 agent aswell, but I don't think that would make much sense. The goal
|
Icinga2 agent aswell, but I don't think that would make much sense. The goal
|
||||||
is instead to create an easy-to-deploy satellite Docker.
|
is instead to create an easy-to-deploy satellite Docker.
|
||||||
|
|
||||||
|
## Tags
|
||||||
|
|
||||||
|
### Main tags
|
||||||
|
* **0.3, latest**
|
||||||
|
* **0.2**
|
||||||
|
* **0.1**
|
||||||
|
|
||||||
|
### Alpine tags (currently has some problems)
|
||||||
|
* **0.1.1-alpine**
|
||||||
|
* **0.1-alpine**
|
||||||
|
|
||||||
|
> **NOTE:** Currently there are some problems with the Alpine image. Use the main images
|
||||||
|
> instead, tagged *0.n*.
|
||||||
|
|
||||||
|
There are two available images for you to choose from. The default ones (0.*n*) are based on
|
||||||
|
Ubuntu 18.04, with Icinga2 from Icingas official repository. The other images (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.
|
||||||
|
|
||||||
## Environment variables
|
## Environment variables
|
||||||
Everything is controlled using the follwing environment variables.
|
Everything is controlled using the following environment variables.
|
||||||
|
|
||||||
* **CN** is the Common Name of the satellite
|
* **CN** is the Common Name of the satellite
|
||||||
* **ZONE** is the zone in which this satellite should be in. If no zone is specified
|
* **ZONE** is the zone in which this satellite should be in. If no zone is specified
|
||||||
@ -60,12 +79,4 @@ services:
|
|||||||
- LOCAL_TIMEZONE=Europe/Stockholm
|
- 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.
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user