2016-08-03 10:09:49 +02:00
|
|
|
FROM ubuntu:trusty
|
2017-04-27 18:32:34 +02:00
|
|
|
LABEL maintainer "Alexey Pustovalov <alexey.pustovalov@zabbix.com>"
|
2016-08-03 10:09:49 +02:00
|
|
|
|
|
|
|
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"
|
|
|
|
ARG DB_TYPE=mysql
|
|
|
|
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive TERM=xterm
|
2016-10-25 01:49:30 +02:00
|
|
|
ENV MIBDIRS=/usr/share/snmp/mibs:/var/lib/zabbix/mibs MIBS=+ALL
|
2016-08-03 10:09:49 +02:00
|
|
|
|
2016-08-03 14:23:39 +02:00
|
|
|
RUN locale-gen $LC_ALL && \
|
2016-08-03 10:09:49 +02:00
|
|
|
echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
|
|
|
|
addgroup --system --quiet zabbix && \
|
|
|
|
adduser --quiet \
|
|
|
|
--system --disabled-login \
|
|
|
|
--ingroup zabbix \
|
|
|
|
--home /var/lib/zabbix/ \
|
|
|
|
zabbix && \
|
|
|
|
mkdir -p /etc/zabbix/ && \
|
|
|
|
mkdir -p /var/lib/zabbix && \
|
|
|
|
mkdir -p /var/lib/zabbix/enc && \
|
|
|
|
mkdir -p /var/lib/zabbix/modules && \
|
|
|
|
mkdir -p /var/lib/zabbix/ssh_keys && \
|
|
|
|
mkdir -p /var/lib/zabbix/ssl && \
|
|
|
|
mkdir -p /var/lib/zabbix/ssl/certs && \
|
|
|
|
mkdir -p /var/lib/zabbix/ssl/keys && \
|
|
|
|
mkdir -p /var/lib/zabbix/ssl/ssl_ca && \
|
2016-08-03 14:23:39 +02:00
|
|
|
mkdir -p /var/lib/zabbix/mibs && \
|
|
|
|
mkdir -p /var/lib/zabbix/snmptraps && \
|
2016-08-03 10:09:49 +02:00
|
|
|
mkdir -p /usr/lib/zabbix/externalscripts && \
|
|
|
|
chown --quiet -R zabbix:root /var/lib/zabbix && \
|
|
|
|
mkdir -p /usr/share/doc/zabbix-proxy-${DB_TYPE} && \
|
|
|
|
apt-get ${APT_FLAGS_COMMON} update && \
|
|
|
|
apt-get ${APT_FLAGS_PERSISTANT} install \
|
|
|
|
supervisor \
|
|
|
|
mysql-client \
|
|
|
|
libmysqlclient18 \
|
|
|
|
libiksemel3 \
|
2016-08-03 14:23:39 +02:00
|
|
|
libsnmp30 \
|
2016-08-03 10:09:49 +02:00
|
|
|
libcurl3 \
|
|
|
|
unixodbc \
|
|
|
|
libssh2-1 \
|
|
|
|
libssl1.0.0 \
|
|
|
|
libxml2 \
|
|
|
|
fping \
|
2016-08-03 14:23:39 +02:00
|
|
|
libopenipmi0 1>/dev/null && \
|
2016-08-03 10:09:49 +02:00
|
|
|
apt-get ${APT_FLAGS_COMMON} autoremove && \
|
|
|
|
apt-get ${APT_FLAGS_COMMON} clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2016-08-03 14:38:00 +02:00
|
|
|
ARG MAJOR_VERSION=3.0
|
2017-04-27 14:11:19 +02:00
|
|
|
ARG ZBX_VERSION=${MAJOR_VERSION}.9
|
2016-08-03 10:09:49 +02:00
|
|
|
ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
|
|
|
|
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} DB_TYPE=${DB_TYPE}
|
|
|
|
|
|
|
|
RUN apt-get ${APT_FLAGS_COMMON} update && \
|
|
|
|
apt-get ${APT_FLAGS_DEV} install \
|
|
|
|
gcc \
|
|
|
|
make \
|
|
|
|
automake \
|
|
|
|
libc6-dev \
|
|
|
|
pkg-config \
|
|
|
|
libmysqlclient-dev \
|
|
|
|
libsnmp-dev \
|
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libldap2-dev \
|
|
|
|
libiksemel-dev \
|
|
|
|
libopenipmi-dev \
|
|
|
|
libssh2-1-dev \
|
|
|
|
unixodbc-dev \
|
|
|
|
libxml2-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 && \
|
2017-04-27 16:59:50 +02:00
|
|
|
export CFLAGS="-fPIC -pie -Wl,-z,relro -Wl,-z,now" && \
|
2016-08-03 10:09:49 +02:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--silent \
|
|
|
|
--sysconfdir=/etc/zabbix \
|
|
|
|
--libdir=/usr/lib/zabbix \
|
2016-10-24 15:11:42 +02:00
|
|
|
--datadir=/usr/lib \
|
2016-08-03 10:09:49 +02:00
|
|
|
--enable-proxy \
|
|
|
|
--enable-ipv6 \
|
|
|
|
--with-jabber \
|
|
|
|
--with-ldap \
|
|
|
|
--with-net-snmp \
|
|
|
|
--with-openipmi \
|
|
|
|
--with-ssh2 \
|
|
|
|
--with-libcurl \
|
|
|
|
--with-unixodbc \
|
|
|
|
--with-libxml2 \
|
|
|
|
--with-openssl \
|
|
|
|
--with-${DB_TYPE} && \
|
|
|
|
make -j"$(nproc)" -s dbschema 1>/dev/null && \
|
|
|
|
make -j"$(nproc)" -s 1>/dev/null && \
|
|
|
|
cp src/zabbix_proxy/zabbix_proxy /usr/sbin/zabbix_proxy && \
|
2017-10-21 16:06:05 +02:00
|
|
|
cp src/zabbix_get/zabbix_get /usr/bin/zabbix_get && \
|
|
|
|
cp src/zabbix_sender/zabbix_sender /usr/bin/zabbix_sender && \
|
2016-08-03 10:09:49 +02:00
|
|
|
cp conf/zabbix_proxy.conf /etc/zabbix/zabbix_proxy.conf && \
|
|
|
|
chown --quiet -R zabbix:root /etc/zabbix && \
|
|
|
|
cp database/${DB_TYPE}/schema.sql /usr/share/doc/zabbix-proxy-${DB_TYPE}/ && \
|
|
|
|
cd /tmp/ && \
|
|
|
|
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
|
|
|
|
apt-get ${APT_FLAGS_COMMON} purge \
|
|
|
|
pkg-config \
|
|
|
|
libsnmp-dev \
|
|
|
|
libmysqlclient-dev \
|
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libldap2-dev \
|
|
|
|
libiksemel-dev \
|
|
|
|
libopenipmi-dev \
|
|
|
|
libssh2-1-dev \
|
|
|
|
unixodbc-dev \
|
|
|
|
libxml2-dev \
|
|
|
|
gcc \
|
|
|
|
libc6-dev \
|
|
|
|
make \
|
|
|
|
automake \
|
|
|
|
subversion 1>/dev/null && \
|
|
|
|
apt-get ${APT_FLAGS_COMMON} autoremove 1>/dev/null && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
EXPOSE 10051/TCP 162/UDP
|
|
|
|
|
|
|
|
WORKDIR /var/lib/zabbix
|
|
|
|
|
|
|
|
VOLUME ["/usr/lib/zabbix/externalscripts", "/var/lib/zabbix/enc", "/var/lib/zabbix/modules", "/var/lib/zabbix/ssh_keys"]
|
2016-08-03 14:23:39 +02:00
|
|
|
VOLUME ["/var/lib/zabbix/ssl/certs", "/var/lib/zabbix/ssl/keys", "/var/lib/zabbix/ssl/ssl_ca", "/var/lib/zabbix/snmptraps", "/var/lib/zabbix/mibs"]
|
2016-08-03 10:09:49 +02:00
|
|
|
|
|
|
|
ADD conf/etc/supervisor/ /etc/supervisor/
|
2016-08-04 07:09:11 +02:00
|
|
|
ADD run_zabbix_component.sh /
|
2016-08-03 10:09:49 +02:00
|
|
|
|
|
|
|
ENTRYPOINT ["/bin/bash"]
|
|
|
|
|
2016-08-04 07:09:11 +02:00
|
|
|
CMD ["/run_zabbix_component.sh", "proxy", "mysql"]
|