github.com/slowteetoe/docker@v1.7.1-rc3/builder/parser/testfiles/cpuguy83-nagios/Dockerfile (about) 1 FROM cpuguy83/ubuntu 2 ENV NAGIOS_HOME /opt/nagios 3 ENV NAGIOS_USER nagios 4 ENV NAGIOS_GROUP nagios 5 ENV NAGIOS_CMDUSER nagios 6 ENV NAGIOS_CMDGROUP nagios 7 ENV NAGIOSADMIN_USER nagiosadmin 8 ENV NAGIOSADMIN_PASS nagios 9 ENV APACHE_RUN_USER nagios 10 ENV APACHE_RUN_GROUP nagios 11 ENV NAGIOS_TIMEZONE UTC 12 13 RUN sed -i 's/universe/universe multiverse/' /etc/apt/sources.list 14 RUN apt-get update && apt-get install -y iputils-ping netcat build-essential snmp snmpd snmp-mibs-downloader php5-cli apache2 libapache2-mod-php5 runit bc postfix bsd-mailx 15 RUN ( egrep -i "^${NAGIOS_GROUP}" /etc/group || groupadd $NAGIOS_GROUP ) && ( egrep -i "^${NAGIOS_CMDGROUP}" /etc/group || groupadd $NAGIOS_CMDGROUP ) 16 RUN ( id -u $NAGIOS_USER || useradd --system $NAGIOS_USER -g $NAGIOS_GROUP -d $NAGIOS_HOME ) && ( id -u $NAGIOS_CMDUSER || useradd --system -d $NAGIOS_HOME -g $NAGIOS_CMDGROUP $NAGIOS_CMDUSER ) 17 18 ADD http://downloads.sourceforge.net/project/nagios/nagios-3.x/nagios-3.5.1/nagios-3.5.1.tar.gz?r=http%3A%2F%2Fwww.nagios.org%2Fdownload%2Fcore%2Fthanks%2F%3Ft%3D1398863696&ts=1398863718&use_mirror=superb-dca3 /tmp/nagios.tar.gz 19 RUN cd /tmp && tar -zxvf nagios.tar.gz && cd nagios && ./configure --prefix=${NAGIOS_HOME} --exec-prefix=${NAGIOS_HOME} --enable-event-broker --with-nagios-command-user=${NAGIOS_CMDUSER} --with-command-group=${NAGIOS_CMDGROUP} --with-nagios-user=${NAGIOS_USER} --with-nagios-group=${NAGIOS_GROUP} && make all && make install && make install-config && make install-commandmode && cp sample-config/httpd.conf /etc/apache2/conf.d/nagios.conf 20 ADD http://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz /tmp/ 21 RUN cd /tmp && tar -zxvf nagios-plugins-1.5.tar.gz && cd nagios-plugins-1.5 && ./configure --prefix=${NAGIOS_HOME} && make && make install 22 23 RUN sed -i.bak 's/.*\=www\-data//g' /etc/apache2/envvars 24 RUN export DOC_ROOT="DocumentRoot $(echo $NAGIOS_HOME/share)"; sed -i "s,DocumentRoot.*,$DOC_ROOT," /etc/apache2/sites-enabled/000-default 25 26 RUN ln -s ${NAGIOS_HOME}/bin/nagios /usr/local/bin/nagios && mkdir -p /usr/share/snmp/mibs && chmod 0755 /usr/share/snmp/mibs && touch /usr/share/snmp/mibs/.foo 27 28 RUN echo "use_timezone=$NAGIOS_TIMEZONE" >> ${NAGIOS_HOME}/etc/nagios.cfg && echo "SetEnv TZ \"${NAGIOS_TIMEZONE}\"" >> /etc/apache2/conf.d/nagios.conf 29 30 RUN mkdir -p ${NAGIOS_HOME}/etc/conf.d && mkdir -p ${NAGIOS_HOME}/etc/monitor && ln -s /usr/share/snmp/mibs ${NAGIOS_HOME}/libexec/mibs 31 RUN echo "cfg_dir=${NAGIOS_HOME}/etc/conf.d" >> ${NAGIOS_HOME}/etc/nagios.cfg 32 RUN echo "cfg_dir=${NAGIOS_HOME}/etc/monitor" >> ${NAGIOS_HOME}/etc/nagios.cfg 33 RUN download-mibs && echo "mibs +ALL" > /etc/snmp/snmp.conf 34 35 RUN sed -i 's,/bin/mail,/usr/bin/mail,' /opt/nagios/etc/objects/commands.cfg && \ 36 sed -i 's,/usr/usr,/usr,' /opt/nagios/etc/objects/commands.cfg 37 RUN cp /etc/services /var/spool/postfix/etc/ 38 39 RUN mkdir -p /etc/sv/nagios && mkdir -p /etc/sv/apache && rm -rf /etc/sv/getty-5 && mkdir -p /etc/sv/postfix 40 ADD nagios.init /etc/sv/nagios/run 41 ADD apache.init /etc/sv/apache/run 42 ADD postfix.init /etc/sv/postfix/run 43 ADD postfix.stop /etc/sv/postfix/finish 44 45 ADD start.sh /usr/local/bin/start_nagios 46 47 ENV APACHE_LOCK_DIR /var/run 48 ENV APACHE_LOG_DIR /var/log/apache2 49 50 EXPOSE 80 51 52 VOLUME ["/opt/nagios/var", "/opt/nagios/etc", "/opt/nagios/libexec", "/var/log/apache2", "/usr/share/snmp/mibs"] 53 54 CMD ["/usr/local/bin/start_nagios"]