Merge "Add kubectl to Nagios image"

This commit is contained in:
Zuul 2019-09-25 15:39:55 +00:00 committed by Gerrit Code Review
commit 53cdce9b9e
1 changed files with 18 additions and 10 deletions

View File

@ -1,14 +1,15 @@
ARG FROM=docker.io/ubuntu:xenial
FROM ${FROM}
ENV VERSION=4.4.3
ENV APACHE_FRONTEND_PORT 8000
ENV APACHE_FRONTEND_SECURE_PORT 8443
ENV ES_DSL_VERSION=5.4.0
ENV ES_VERSION=5.5.3
ENV KUBE_VERSION=1.13.4
ENV NAGIOSADMIN_EMAIL nagios@localhost
ENV NAGIOS_HOME /opt/nagios
ENV NAGIOS_PLUGIN_DIR /usr/lib/nagios/plugins
ENV APACHE_FRONTEND_PORT 8000
ENV APACHE_FRONTEND_SECURE_PORT 8443
ENV ES_VERSION=5.5.3
ENV ES_DSL_VERSION=5.4.0
ENV VERSION=4.4.3
RUN apt-get -o Acquire::ForceIPv4=true -y update \
&& apt-get -y install curl apache2 checkinstall unzip libapache2-mod-php snmp snmpd snmp-mibs-downloader jq python-requests \
@ -29,9 +30,15 @@ RUN groupadd -g 3000 nagios
RUN useradd -u 3000 -g nagios -d ${NAGIOS_HOME} -s /bin/bash -c 'Nagios Admin' nagios
RUN adduser www-data nagios
ADD https://assets.nagios.com/downloads/nagioscore/releases/nagios-${VERSION}.tar.gz /tmp/
RUN cd /tmp && \
tar zxf /tmp/nagios-${VERSION}.tar.gz && \
RUN TMP_DIR=$(mktemp --directory) ;\
cd ${TMP_DIR} ;\
curl -sSL https://dl.k8s.io/v${KUBE_VERSION}/kubernetes-client-linux-amd64.tar.gz | tar -zxv --strip-components=1 ;\
mv ${TMP_DIR}/client/bin/kubectl /usr/local/bin/kubectl ;\
chmod +x /usr/local/bin/kubectl
ADD https://assets.nagios.com/downloads/nagioscore/releases/nagios-${VERSION}.tar.gz ${TMP_DIR}/
RUN cd ${TMP_DIR} && \
tar zxf ${TMP_DIR}/nagios-${VERSION}.tar.gz && \
cd nagios-${VERSION} && \
./configure --with-lockfile=/var/run/nagios.lock --prefix=${NAGIOS_HOME} --with-nagios-user=nagios --with-nagios-group=nagios --with-command-user=nagios --with-command-group=nagios && \
make all && \
@ -40,8 +47,9 @@ RUN cd /tmp && \
make install-config && \
make install-commandmode && \
make install-webconf && \
cd /tmp && \
rm -rf nagios-*
cd ${TMP_DIR} && \
rm -rf nagios-* && \
rm -rf ${TMP_DIR}
COPY apache2/sites-available/* /etc/apache2/sites-available/
COPY apache2/ports.conf /etc/apache2/