zabbix-docker/agent/ubuntu/Dockerfile
2016-08-23 12:51:31 -07:00

91 lines
3.2 KiB
Docker

FROM ubuntu:trusty
MAINTAINER Alexey Pustovalov <alexey.pustovalov@zabbix.com>
ARG APT_FLAGS_COMMON="-qq -y"
ARG APT_FLAGS_PERSISTANT="${APT_FLAGS_COMMON} --no-install-recommends"
ARG APT_FLAGS_DEV="${APT_FLAGS_COMMON} --no-install-recommends"
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
RUN DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \
locale-gen $LC_ALL && \
echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
echo "deb http://us.archive.ubuntu.com/ubuntu/ $DISTRIB_CODENAME multiverse" >> /etc/apt/sources.list && \
addgroup --system --quiet zabbix && \
adduser --quiet \
--system --disabled-login \
--ingroup zabbix \
--home /var/lib/zabbix/ \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
chown --quiet -R zabbix:root /var/lib/zabbix && \
apt-get ${APT_FLAGS_COMMON} update && \
apt-get ${APT_FLAGS_PERSISTANT} install \
supervisor \
libssl1.0.0 1>/dev/null && \
apt-get ${APT_FLAGS_COMMON} autoremove && \
apt-get ${APT_FLAGS_COMMON} clean && \
rm -rf /var/lib/apt/lists/*
ARG MAJOR_VERSION=3.2
ARG ZBX_VERSION=${MAJOR_VERSION}.0beta1
ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
RUN apt-get ${APT_FLAGS_COMMON} update && \
apt-get ${APT_FLAGS_DEV} install \
gcc \
make \
automake \
libc6-dev \
pkg-config \
libssl-dev \
subversion 1>/dev/null && \
cd /tmp/ && \
svn --quiet export ${ZBX_SOURCES} zabbix-${ZBX_VERSION} && \
cd /tmp/zabbix-${ZBX_VERSION} && \
zabbix_revision=`svn info ${ZBX_SOURCES} |grep "Last Changed Rev"|awk '{print $4;}'` && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \
./bootstrap.sh 1>/dev/null && \
./configure \
--prefix=/usr \
--silent \
--sysconfdir=/etc/zabbix \
--libdir=/usr/lib/zabbix \
--enable-agent \
--enable-ipv6 \
--with-openssl && \
make -j"$(nproc)" -s 1>/dev/null && \
cp src/zabbix_agent/zabbix_agentd /usr/sbin/zabbix_agentd && \
cp conf/zabbix_agentd.conf /etc/zabbix/ && \
chown --quiet -R zabbix:root /etc/zabbix && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
apt-get ${APT_FLAGS_COMMON} purge \
gcc \
make \
automake \
libc6-dev \
pkg-config \
libssl-dev \
subversion 1>/dev/null && \
apt-get ${APT_FLAGS_COMMON} autoremove && \
apt-get ${APT_FLAGS_COMMON} clean && \
rm -rf /var/lib/apt/lists/*
EXPOSE 10050/TCP
WORKDIR /var/lib/zabbix
VOLUME ["/etc/zabbix/zabbix_agentd.d", "/var/lib/zabbix/enc", "/var/lib/zabbix/modules"]
ADD conf/etc/supervisor/ /etc/supervisor/
ADD run_zabbix_component.sh /
ENTRYPOINT ["/bin/bash"]
CMD ["/run_zabbix_component.sh", "agentd", "none"]