zabbix-docker/agent/alpine/Dockerfile

81 lines
2.6 KiB
Docker
Raw Normal View History

2017-03-11 23:13:50 +01:00
FROM alpine:3.4
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 APK_FLAGS_COMMON="-q"
ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
ENV TERM=xterm
RUN addgroup zabbix && \
adduser -S \
-D -G zabbix \
-h /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 && \
apk update && \
apk add ${APK_FLAGS_PERSISTANT} \
2017-05-25 18:19:08 +02:00
iputils \
2016-08-03 10:09:49 +02:00
supervisor \
bash \
coreutils \
libssl1.0 && \
rm -rf /var/cache/apk/*
2016-08-03 14:38:00 +02:00
ARG MAJOR_VERSION=3.0
2017-11-09 14:40:17 +01:00
ARG ZBX_VERSION=${MAJOR_VERSION}.13
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}
RUN apk update && \
apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
alpine-sdk \
automake \
autoconf \
openssl-dev \
subversion && \
cd /tmp/ && \
svn --quiet export ${ZBX_SOURCES} zabbix-${ZBX_VERSION} 1>/dev/null && \
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 && \
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 \
--datadir=/usr/lib \
2016-08-03 10:09:49 +02:00
--enable-agent \
--enable-ipv6 \
--with-openssl && \
make -j"$(nproc)" -s 1>/dev/null && \
cp src/zabbix_agent/zabbix_agentd /usr/sbin/zabbix_agentd && \
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_agentd.conf /etc/zabbix && \
chown --quiet -R zabbix:root /etc/zabbix && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
apk del --purge \
build-dependencies && \
rm -rf /var/cache/apk/*
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/
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", "agentd", "none"]