zabbix-docker/java-gateway/alpine/Dockerfile

72 lines
2.3 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-08-03 14:36:06 +02:00
ARG MAJOR_VERSION=master
ARG ZBX_VERSION=${MAJOR_VERSION}
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 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 \
--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"]