This commit is contained in:
2024-04-07 15:50:57 +03:00
parent 8079e21c5f
commit 344d248a30
4 changed files with 27 additions and 63 deletions

View File

@@ -1,27 +1,14 @@
ARG BUILD_ARCH
ARG BUILD_VERSION
ARG BUILD_BASE_IMAGE=zabbix/zabbix-agent2:alpine-trunk
ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base/amd64
ARG BUILD_ARCH=amd64
FROM ${BUILD_BASE_IMAGE} as builder
FROM ${BUILD_FROM}
FROM alpine
RUN apt-get update && apt-get install -y wget
RUN wget https://repo.zabbix.com/zabbix/6.5/debian/pool/main/z/zabbix-release/zabbix-release_6.5-1+debian12_all.deb && dpkg -i zabbix-release_6.5-1+debian12_all.deb
LABEL maintainer "sinav"
RUN apt-get update && apt-get install -y zabbix-agent2 zabbix-agent2-plugin-*
RUN usermod -aG docker zabbix
ENV LANG C.UTF-8
COPY rootfs /
# Install requirements for add-on
RUN apk add --no-cache jq zabbix-agent2 && \
addgroup -g 1003 docker && \
addgroup zabbix docker && \
mkdir -p /etc/zabbix/zabbix_agent2.d/plugins.d
# Copy zabbix-agent2 plugins
COPY --from=builder ["/usr/sbin/zabbix-agent2-plugin", "/usr/sbin/zabbix-agent2-plugin"]
RUN echo -e "\nPlugins.PostgreSQL.System.Path=/usr/sbin/zabbix-agent2-plugin/zabbix-agent2-plugin-mongodb\nPlugins.PostgreSQL.System.Path=/usr/sbin/zabbix-agent2-plugin/zabbix-agent2-plugin-postgresql\n" >> /etc/zabbix/zabbix_agent2.conf
# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]
RUN chmod a+x /etc/services.d/zabbix-agent2/run