zabbix-docker/java-gateway/alpine/Dockerfile

73 lines
2.4 KiB
Docker
Raw Normal View History

2016-08-03 10:09:49 +02:00
FROM alpine:latest
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/*
2016-10-28 16:09:29 +02:00
ARG MAJOR_VERSION=3.4
2016-10-28 16:10:53 +02:00
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG ZBX_SOURCES=svn://svn.zabbix.com/trunk/
2016-08-03 10:09:49 +02:00
ENV ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES}
RUN apk add ${APK_FLAGS_DEV} --virtual build-dependencies \
alpine-sdk \
coreutils \
automake \
autoconf \
openjdk8 \
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 \
2016-08-03 10:09:49 +02:00
--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/
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", "java-gateway", "none"]