zabbix-docker/java-gateway/alpine/Dockerfile
2017-10-21 17:34:03 +03:00

74 lines
2.4 KiB
Docker

FROM alpine:3.4
LABEL maintainer "Alexey Pustovalov <alexey.pustovalov@zabbix.com>"
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/ \
-H \
zabbix && \
mkdir -p /etc/zabbix/ && \
chown --quiet -R zabbix:root /etc/zabbix && \
apk update && \
apk add ${APK_FLAGS_COMMON} \
supervisor \
bash \
openjdk8-jre-base && \
rm -rf /var/cache/apk/*
ARG MAJOR_VERSION=3.4
ARG ZBX_VERSION=${MAJOR_VERSION}.3
ARG ZBX_SOURCES=svn://svn.zabbix.com/tags/${ZBX_VERSION}/
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
alpine-sdk \
coreutils \
automake \
autoconf \
openjdk8 \
pcre-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 && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java && \
export PATH=$PATH:/usr/lib/jvm/default-jvm/bin/ && \
./bootstrap.sh 1>/dev/null && \
./configure \
--prefix=/usr \
--silent \
--sysconfdir=/etc/zabbix \
--libdir=/usr/lib/zabbix \
--datadir=/usr/lib \
--enable-java && \
make -j"$(nproc)" -s 1>/dev/null && \
mkdir -p /usr/sbin/zabbix_java/ && \
cp -r src/zabbix_java/bin /usr/sbin/zabbix_java/ && \
cp -r src/zabbix_java/lib /usr/sbin/zabbix_java/ && \
cd /tmp/ && \
rm -rf /tmp/zabbix-${ZBX_VERSION}/ && \
apk del ${APK_FLAGS_COMMON} --purge \
build-dependencies && \
rm -rf /var/cache/apk/*
EXPOSE 10052/TCP
WORKDIR /usr/sbin/zabbix_java/
ADD conf/etc/supervisor/ /etc/supervisor/
ADD conf/etc/zabbix/zabbix_java_gateway_logback.xml /etc/zabbix/
ADD conf/usr/sbin/zabbix_java_gateway /usr/sbin/
ADD run_zabbix_component.sh /
ENTRYPOINT ["/bin/bash"]
CMD ["/run_zabbix_component.sh", "java-gateway", "none"]