zabbix-docker/Dockerfiles/java-gateway/alpine/Dockerfile

85 lines
2.8 KiB
Docker
Raw Normal View History

# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=6.0
2024-07-15 12:50:48 +02:00
ARG ZBX_VERSION=${MAJOR_VERSION}.32
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION}
2024-05-30 11:13:32 +02:00
FROM ${BUILD_BASE_IMAGE} AS builder
FROM alpine:3.19
2018-02-18 21:42:44 +01:00
ARG MAJOR_VERSION
ARG ZBX_VERSION
2021-10-16 17:49:19 +02:00
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
2021-10-16 17:49:19 +02:00
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} ZBX_SOURCES=${ZBX_SOURCES} \
PATH=${PATH}:/usr/lib/jvm/default-jvm/bin/ JAVA_HOME=/usr/lib/jvm/default-jvm
2021-10-16 17:49:19 +02:00
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix Java Gateway performs native support for monitoring JMX applications" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
2021-10-16 17:49:19 +02:00
org.opencontainers.image.licenses="GPL v2.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix Java Gateway" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
2021-10-16 17:49:19 +02:00
org.opencontainers.image.version="${ZBX_VERSION}"
2018-02-18 21:42:44 +01:00
STOPSIGNAL SIGTERM
2016-08-03 10:09:49 +02:00
2024-06-01 08:10:31 +02:00
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/java_gateway/sbin/", "/usr/sbin/zabbix_java/"]
2019-05-30 20:21:16 +02:00
RUN set -eux && \
ARCH_SUFFIX="$(cat /etc/apk/arch)"; \
2024-01-29 08:26:07 +01:00
case "$ARCH_SUFFIX" in \
x86) \
2024-02-05 09:15:37 +01:00
openjdk_packages='openjdk8-jre-base'; \
;; \
2024-02-05 12:10:01 +01:00
armv7) \
openjdk_packages='openjdk8 openjdk8-jre-base'; \
;; \
2024-01-29 08:26:07 +01:00
ppc64le) \
openjdk_packages='openjdk11-jre-headless'; \
;; \
*) openjdk_packages='openjdk17-jre-headless'; \
esac; \
2021-10-16 17:49:19 +02:00
INSTALL_PKGS="bash \
2024-01-29 08:26:07 +01:00
$openjdk_packages" && \
2021-10-16 17:49:19 +02:00
apk add \
--no-cache \
--clean-protected \
${INSTALL_PKGS} && \
addgroup \
--system \
--gid 1995 \
zabbix && \
adduser \
--system \
--gecos "Zabbix monitoring system" \
--disabled-password \
--uid 1997 \
--ingroup zabbix \
--shell /sbin/nologin \
--home /var/lib/zabbix/ \
2016-08-03 10:09:49 +02:00
zabbix && \
mkdir -p /etc/zabbix/ && \
mkdir -p /usr/sbin/zabbix_java/ext_lib/ && \
2021-09-13 17:44:52 +02:00
rm -rf /usr/sbin/zabbix_java/lib/logback.xml && \
mv /usr/sbin/zabbix_java/lib/logback-console.xml /etc/zabbix/zabbix_java_gateway_logback.xml && \
2020-04-27 17:27:35 +02:00
chown --quiet -R zabbix:root /etc/zabbix/ /usr/sbin/zabbix_java/ && \
chgrp -R 0 /etc/zabbix/ /usr/sbin/zabbix_java/ && \
chmod -R g=u /etc/zabbix/ /usr/sbin/zabbix_java/
2016-08-03 10:09:49 +02:00
EXPOSE 10052/TCP
2018-02-18 21:42:44 +01:00
WORKDIR /var/lib/zabbix
2016-08-03 10:09:49 +02:00
2018-02-18 21:42:44 +01:00
COPY ["conf/usr/sbin/zabbix_java_gateway", "/usr/sbin/"]
COPY ["docker-entrypoint.sh", "/usr/bin/"]
2016-08-03 10:09:49 +02:00
2018-02-18 21:42:44 +01:00
ENTRYPOINT ["docker-entrypoint.sh"]
2020-04-25 19:31:44 +02:00
USER 1997
CMD ["/usr/sbin/zabbix_java_gateway"]