Delete DOckerfiles

This commit is contained in:
Snarp 2026-07-24 19:33:32 +02:00
parent 29e5fe8f9f
commit 23c17a9c8b
537 changed files with 0 additions and 32273 deletions

View file

@ -1,243 +0,0 @@
![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png)
# What is Zabbix?
Zabbix is an enterprise-class open source distributed monitoring solution.
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
# What is Zabbix agent?
Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications (hard drives, memory, processor statistics etc).
# Zabbix agent images
These are the only official Zabbix agent Docker images. They are based on Alpine Linux v3.24, Ubuntu 26.04 (resolute), CentOS Stream 10, Oracle Linux 10, Windows 10 LTSC 2019 and Windows 11 LTSC 2022 images. The available versions of Zabbix agent are:
Zabbix agent 6.0 (tags: alpine-6.0-latest, ubuntu-6.0-latest, ol-6.0-latest)
Zabbix agent 6.0.* (tags: alpine-6.0.*, ubuntu-6.0.*, ol-6.0.*, ltsc2019-6.0.*, ltsc2022-6.0.*)
Zabbix agent 7.0 (tags: alpine-7.0-latest, ubuntu-7.0-latest, ol-7.0-latest)
Zabbix agent 7.0.* (tags: alpine-7.0.*, ubuntu-7.0.*, ol-7.0.*, ltsc2019-7.0.*, ltsc2022-7.0.*)
Zabbix agent 7.2 (tags: alpine-7.2-latest, ubuntu-7.2-latest, ol-7.2-latest)
Zabbix agent 7.2.* (tags: alpine-7.2.*, ubuntu-7.2.*, ol-7.2.*, ltsc2019-7.2.*, ltsc2022-7.2.*)
Zabbix agent 7.4 (tags: alpine-7.4-latest, ubuntu-7.4-latest, ol-7.4-latest, alpine-latest, ubuntu-latest, ol-latest, ltsc2019-latest, ltsc2022-latest, latest)
Zabbix agent 7.4.* (tags: alpine-7.4.*, ubuntu-7.4.*, ol-7.4.*, ltsc2019-7.4.*, ltsc2022-7.4.*)
Zabbix agent 8.0 (tags: alpine-trunk, ubuntu-trunk, ol-trunk, ltsc2019-trunk, ltsc2022-trunk)
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
# How to use this image
## Start `zabbix-agent`
Start a Zabbix agent container as follows:
docker run --name some-zabbix-agent -e ZBX_HOSTNAME="some-hostname" -e ZBX_SERVER_HOST="some-zabbix-server" --init -d zabbix/zabbix-agent:tag
Where `some-zabbix-agent` is the name you want to assign to your container, `some-hostname` is the hostname, it is Hostname parameter in Zabbix agent configuration file, `some-zabbix-server` is IP or DNS name of Zabbix server or proxy and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-agent/tags/).
## Connects from Zabbix server or Zabbix proxy in other containers (Passive checks)
This image exposes the standard Zabbix agent port (``10050``) to perform passive checks, so container linking makes Zabbix agent instance available to Zabbix server and Zabbix proxy containers. Start your application container like this in order to link it to the Zabbix agent container:
```console
$ docker run --name some-zabbix-server --link some-zabbix-agent:zabbix-agent --init -d zabbix/zabbix-server:latest
```
## Connect to Zabbix server or Zabbix proxy containers (Active checks)
This image supports perform active checks, so container linking makes Zabbix server and Zabbix proxy containers available to Zabbix agent instance. Start your application container like this in order to link Zabbix agent to Zabbix server or Zabbix proxy containers:
```console
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server --init -d zabbix/zabbix-agent:latest
```
## Container shell access and viewing Zabbix agent logs
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-agent` container:
```console
$ docker exec -ti some-zabbix-agent /bin/bash
```
The Zabbix agent log is available through Docker's container log:
```console
$ docker logs some-zabbix-agent
```
## Privileged mode
By default, Docker containers are "unprivileged" and do not have access to the most of host resources. Zabbix agent is designed to monitor system resources, to do that Zabbix agent container must be privileged or you may mount some system-wide volumes. For example:
```console
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server --privileged --init -d zabbix/zabbix-agent:latest
```
```console
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server -v /dev/sdc:/dev/sdc --init -d zabbix/zabbix-agent:latest
```
## Environment Variables
When you start the `zabbix-agent` image, you can adjust the configuration of the Zabbix agent by passing one or more environment variables on the `docker run` command line.
### `ZBX_HOSTNAME`
This variable is unique, case sensitive hostname. By default, value is `hostname` of the container. It is ``Hostname`` parameter in ``zabbix_agentd.conf``.
### `ZBX_SERVER_HOST`
This variable is IP or DNS name of Zabbix server or Zabbix proxy. By default, value is `zabbix-server`. It is ``Server`` parameter in ``zabbix_agentd.conf``. It is allowed to specify Zabbix server or Zabbix proxy port number using ``ZBX_SERVER_PORT`` variable. It make sense in case of non-default port for active checks.
### `ZBX_PASSIVE_ALLOW`
This variable is boolean (``true`` or ``false``) and enables or disables feature of passive checks. By default, value is `true`.
### `ZBX_PASSIVESERVERS`
The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container.
### `ZBX_ACTIVE_ALLOW`
This variable is boolean (``true`` or ``false``) and enables or disables feature of active checks. By default, value is `true`.
### `ZBX_ACTIVESERVERS`
The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container. You may specify port of Zabbix server or Zabbix proxy in such syntax: ``zabbix-server:10061,zabbix-proxy:10072``.
### `ZBX_LOADMODULE`
The variable is list of comma separated loadable Zabbix modules. It works with volume ``/var/lib/zabbix/modules``. The syntax of the variable is ``dummy1.so,dummy2.so``.
### `ZBX_DEBUGLEVEL`
The variable is used to specify debug level. By default, value is ``3``. It is ``DebugLevel`` parameter in ``zabbix_agentd.conf``. Allowed values are listed below:
- ``0`` - basic information about starting and stopping of Zabbix processes;
- ``1`` - critical information
- ``2`` - error information
- ``3`` - warnings
- ``4`` - for debugging (produces lots of information)
- ``5`` - extended debugging (produces even more information)
### `ZBX_TIMEOUT`
The variable is used to specify timeout for processing checks. By default, value is ``3``.
### Other variables
Additionally the image allows to specify many other environment variables listed below:
```
ZBX_SOURCEIP=
ZBX_ENABLEREMOTECOMMANDS=0 # Deprecated since 5.0.0
ZBX_LOGREMOTECOMMANDS=0
ZBX_HEARTBEAT_FREQUENCY=60 # Available since 6.2.0
ZBX_HOSTINTERFACE= # Available since 4.4.0
ZBX_HOSTINTERFACEITEM= # Available since 4.4.0
ZBX_STARTAGENTS=10
ZBX_HOSTNAMEITEM=system.hostname
ZBX_METADATA=
ZBX_METADATAITEM=
ZBX_REFRESHACTIVECHECKS=5
ZBX_BUFFERSEND=5
ZBX_BUFFERSIZE=100
ZBX_MAXLINESPERSECOND=20
ZBX_LISTENIP=
ZBX_LISTENPORT=10050
ZBX_LISTENBACKLOG=
ZBX_UNSAFEUSERPARAMETERS=0
ZBX_TLSCONNECT=unencrypted
ZBX_TLSACCEPT=unencrypted
ZBX_TLSCAFILE=
ZBX_TLSCA=
ZBX_TLSCRLFILE=
ZBX_TLSCRL=
ZBX_TLSSERVERCERTISSUER=
ZBX_TLSSERVERCERTSUBJECT=
ZBX_TLSCERTFILE=
ZBX_TLSCERT=
ZBX_TLSKEYFILE=
ZBX_TLSKEY=
ZBX_TLSPSKIDENTITY=
ZBX_TLSPSKFILE=
ZBX_TLSPSK=
ZBX_TLSCIPHERALL= # Available since 4.4.7
ZBX_TLSCIPHERALL13= # Available since 4.4.7
ZBX_TLSCIPHERCERT= # Available since 4.4.7
ZBX_TLSCIPHERCERT13= # Available since 4.4.7
ZBX_TLSCIPHERPSK= # Available since 4.4.7
ZBX_TLSCIPHERPSK13= # Available since 4.4.7
ZBX_DENYKEY=system.run[*] # Available since 5.0.0
ZBX_ALLOWKEY= # Available since 5.0.0
```
Default values of these variables are specified after equal sign.
The allowed variables are identical of parameters in official ``zabbix_agentd.conf`` configuration file. For example, ``ZBX_REFRESHACTIVECHECKS`` = ``RefreshActiveChecks``.
Please use official documentation for [``zabbix_agentd.conf``](https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_agentd) to get more information about the variables.
## Allowed volumes for the Zabbix agent container
### ``/etc/zabbix/zabbix_agentd.d``
The volume allows include ``*.conf`` files and extend Zabbix agent using ``UserParameter`` feature.
### ``/var/lib/zabbix/modules``
The volume allows load additional modules and extend Zabbix agent using ``LoadModule`` feature.
### ``/var/lib/zabbix/enc``
The volume is used to store TLS related files. These file names are specified using ``ZBX_TLSCAFILE``, ``ZBX_TLSCRLFILE``, ``ZBX_TLSCERTFILE``, ``ZBX_TLSKEYFILE`` and ``ZBX_TLSPSKFILE`` variables. Additionally it is possible to use environment variables ``ZBX_TLSCA``, ``ZBX_TLSCRL``, ``ZBX_TLSCERT``, ``ZBX_TLSKEY`` and ``ZBX_TLSPSK`` with plaintext values.
# The image variants
The `zabbix-agent` images come in many flavors, each designed for a specific use case.
## `zabbix-agent:alpine-<version>`
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
## `zabbix-agent:ubuntu-<version>`
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
## `zabbix-agent:ol-<version>`
Oracle Linux is an open-source operating system available under the GNU General Public License (GPLv2). Suitable for general purpose or Oracle workloads, it benefits from rigorous testing of more than 128,000 hours per day with real-world workloads and includes unique innovations such as Ksplice for zero-downtime kernel patching, DTrace for real-time diagnostics, the powerful Btrfs file system, and more.
# User Feedback
## Documentation
Documentation for this image is stored in the [`agent/` directory](https://github.com/zabbix/zabbix-docker/tree/7.4/Dockerfiles/agent) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/7.4/README.md) before attempting a pull request.
## Issues
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
### Known issues
Currently it is not allowed to specify ``ZBX_ALIAS`` environment variable. Please use ``/etc/zabbix/zabbix_agentd.d`` volume with additional configuration files with ``Alias`` options.
## Contributing
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
## License
Starting from Zabbix version 7.0, all subsequent Zabbix versions will be released under the GNU Affero General Public License version 3 (AGPLv3).
You can modify the relevant version and propagate such modified version under the terms of the AGPLv3 as published by the Free Software Foundation.
For additional details, including answers to common questions about the AGPLv3, see the generic FAQ from the [Free Software Foundation](http://www.fsf.org/licenses/gpl-faq.html).
Zabbix is Open Source Software, however, if you use Zabbix in a commercial context we kindly ask you to support the development of Zabbix by purchasing some level of technical support.
All previous Zabbix software versions up to 6.4 are released under the GNU General Public License version 2 (GPLv2). The formal terms of the GPLv2 and AGPLv3 can be found at http://www.fsf.org/licenses/.

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,102 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=alpine:3.24
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_LOADMODULEPATH=${ZABBIX_USER_HOME_DIR}/modules \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix agent" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/conf/ ${ZABBIX_CONF_DIR}/
RUN set -eux && \
INSTALL_PKGS="bash \
coreutils \
tzdata \
c-ares \
libcurl \
libgcc \
libldap \
libmodbus \
pcre2 \
zlib \
iputils" && \
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 ${ZABBIX_USER_HOME_DIR} \
zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/modules \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agentd -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
USER 1997
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/sbin/zabbix_agentd", "--foreground", "-c", "/etc/zabbix/zabbix_agentd.conf"]

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,116 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=quay.io/centos/centos:stream10-minimal
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix agent" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/conf/ ${ZABBIX_CONF_DIR}/
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
shadow-utils \
c-ares \
libcurl-minimal \
libmodbus \
openldap \
openssl-libs \
pcre2 \
zlib \
iputils" && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="extras-common" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
epel-release && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="baseos" \
--enablerepo="appstream" \
--enablerepo="epel" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
${INSTALL_PKGS} && \
groupadd \
--system \
--gid 1995 \
zabbix && \
useradd \
--system \
--comment "Zabbix monitoring system" \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/modules \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agentd -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
USER 1997
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/sbin/zabbix_agentd", "--foreground", "-c", "/etc/zabbix/zabbix_agentd.conf"]

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,114 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_LOADMODULEPATH="${ZABBIX_USER_HOME_DIR}/modules" \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix agent" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/conf/ ${ZABBIX_CONF_DIR}/
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
c-ares \
libcurl \
libmodbus \
openssl-libs \
pcre2 \
zlib \
iputils" && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ol10_baseos_latest" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
oracle-epel-release-el10 && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ol10_baseos_latest" \
--enablerepo="ol10_appstream" \
--enablerepo="ol10_u1_developer_EPEL" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
${INSTALL_PKGS} && \
groupadd \
--system \
--gid 1995 \
zabbix && \
useradd \
--system \
--comment "Zabbix monitoring system" \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/modules \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agentd -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
USER 1997
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/sbin/zabbix_agentd", "--foreground", "-c", "/etc/zabbix/zabbix_agentd.conf"]

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,131 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=registry.access.redhat.com/ubi10/ubi-minimal:10.2
ARG MAJOR_VERSION=7.4
ARG RELEASE=12
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG RELEASE
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_LOADMODULEPATH=${ZABBIX_USER_HOME_DIR}/modules \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
maintainer="alexey.pustovalov@zabbix.com" \
name="zabbix/zabbix-agent-74" \
release="${RELEASE}" \
run="podman run --name zabbix-agent -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent-74:${ZBX_VERSION}" \
summary="Zabbix agent" \
url="https://www.zabbix.com/" \
vendor="Zabbix SIA" \
version="${MAJOR_VERSION}" \
io.k8s.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
io.k8s.display-name="Zabbix Agent" \
io.openshift.expose-services="10050:10050" \
io.openshift.tags="zabbix,zabbix-agent" \
org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
org.label-schema.docker.cmd="podman run --name zabbix-agent -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent-74:${ZBX_VERSION}" \
org.label-schema.license="AGPL v3.0" \
org.label-schema.name="zabbix-agent-rhel" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://zabbix.com/" \
org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.label-schema.vcs-ref="${VCS_REF}" \
org.label-schema.vcs-url="${ZBX_SOURCES}" \
org.label-schema.vendor="Zabbix SIA" \
org.label-schema.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY licenses /licenses/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/conf/ ${ZABBIX_CONF_DIR}/
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
shadow-utils \
tzdata \
c-ares \
libcurl-minimal \
libmodbus \
openldap \
pcre2 \
zlib \
iputils" && \
curl --tlsv1.2 -sSf -L https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm -o /tmp/epel-release-latest-10.noarch.rpm && \
rpm -ivh /tmp/epel-release-latest-10.noarch.rpm && \
rm -rf /tmp/epel-release-latest-10.noarch.rpm && \
ARCH_SUFFIX="$(arch)"; \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ubi-10-baseos-rpms" \
--enablerepo="rhel-10-for-$ARCH_SUFFIX-baseos-rpms" \
--enablerepo="epel" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--setopt=tsflags=nodocs \
${INSTALL_PKGS} && \
groupadd \
--system \
--gid 1995 \
zabbix && \
useradd \
--system \
--comment "Zabbix monitoring system" \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/modules \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agentd -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
USER 1997
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/sbin/zabbix_agentd", "--foreground", "-c", "/etc/zabbix/zabbix_agentd.conf"]

View file

@ -1,140 +0,0 @@
<h2>What is Zabbix?</h2>
<p>Zabbix is an enterprise-class open source distributed monitoring solution.</p>
<p>Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.</p>
<p>For more information and related downloads for Zabbix components, please visit <a href="https://zabbix.com">zabbix.com</a></p>
<h2>What is Zabbix agent?</h2>
<p>Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications (hard drives, memory, processor statistics etc).</p>
<h2>Zabbix agent images</h2>
<p>Images are updated when new releases are published.</p>
<h2>How to use this image</h2>
<h3>Start <code>zabbix-agent</code></h3>
<p>Start a Zabbix agent container as follows:</p>
<pre><code>podman run \
--name some-zabbix-agent \
-e ZBX_HOSTNAME="some-hostname" \
-e ZBX_SERVER_HOST="some-zabbix-server" \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent-74:tag
</code></pre>
<p>Where <code>some-zabbix-agent</code> is the name you want to assign to your container, <code>some-hostname</code> is the hostname, it is Hostname parameter in Zabbix agent configuration file, <code>some-zabbix-server</code> is IP or DNS name of Zabbix server or proxy and <code>tag</code> is the tag specifying the version you want.</p>
<h3>Connects from Zabbix server or Zabbix proxy in other containers (Passive checks)</h3>
<p>This image exposes the standard Zabbix agent port (<code>10050</code>) to perform passive checks, so container linking makes Zabbix agent instance available to Zabbix server and Zabbix proxy containers. Start your application container like this in order to link it to the Zabbix agent container:</p>
<pre><code>$ podman run \
--name some-zabbix-server \
--link some-zabbix-agent:zabbix-agent \
--init \
-d zabbix/zabbix-server:latest
</code></pre>
<h3>Connect to Zabbix server or Zabbix proxy containers (Active checks)</h3>
<p>This image supports perform active checks, so container linking makes Zabbix server and Zabbix proxy containers available to Zabbix agent instance. Start your application container like this in order to link Zabbix agent to Zabbix server or Zabbix proxy containers:</p>
<pre><code>$ podman run \
--name some-zabbix-agent \
--link some-zabbix-server:zabbix-server \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent-74:latest
</code></pre>
<h3>Container shell access and viewing Zabbix agent logs</h3>
<p>The <code>podman exec</code> command allows you to run commands inside a Podman container. The following command line will give you a bash shell inside your <code>zabbix-agent</code> container:</p>
<pre><code>$ podman exec -ti some-zabbix-agent /bin/bash
</code></pre>
<p>The Zabbix agent log is available through Podman's container log:</p>
<pre><code>$ podman logs some-zabbix-agent
</code></pre>
<h3>Privileged mode</h3>
<p>By default, Podman containers are "unprivileged" and do not have access to the most of host resources. Zabbix agent is designed to monitor system resources, to do that Zabbix agent container must be privileged or you may mount some system-wide volumes. For example:</p>
<pre><code>$ podman run \
--name some-zabbix-agent \
--link some-zabbix-server:zabbix-server \
--privileged \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent-74:latest
</code></pre>
<pre><code>$ podman run \
--name some-zabbix-agent \
--link some-zabbix-server:zabbix-server \
-v /dev/sdc:/dev/sdc \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent-74:latest
</code></pre>
<h3>Environment Variables</h3>
<p>When you start the <code>zabbix-agent</code> image, you can adjust the configuration of the Zabbix agent by passing one or more environment variables on the <code>podman run</code> command line.</p>
<h4><code>ZBX_HOSTNAME</code></h4>
<p>This variable is unique, case sensitive hostname. By default, value is <code>hostname</code> of the container. It is <code>Hostname</code> parameter in <code>zabbix_agentd.conf</code>.</p>
<h4><code>ZBX_SERVER_HOST</code></h4>
<p>This variable is IP or DNS name of Zabbix server or Zabbix proxy. By default, value is <code>zabbix-server</code>. It is <code>Server</code> parameter in <code>zabbix_agentd.conf</code>. It is allowed to specify Zabbix server or Zabbix proxy port number using <code>ZBX_SERVER_PORT</code> variable. It make sense in case of non-default port for active checks.</p>
<h4><code>ZBX_PASSIVE_ALLOW</code></h4>
<p>This variable is boolean (<code>true</code> or <code>false</code>) and enables or disables feature of passive checks. By default, value is <code>true</code>.</p>
<h4><code>ZBX_PASSIVESERVERS</code></h4>
<p>The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container.</p>
<h4><code>ZBX_ACTIVE_ALLOW</code></h4>
<p>This variable is boolean (<code>true</code> or <code>false</code>) and enables or disables feature of active checks. By default, value is <code>true</code>.</p>
<h4><code>ZBX_ACTIVESERVERS</code></h4>
<p>The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container. You may specify port of Zabbix server or Zabbix proxy in such syntax: <code>zabbix-server:10061,zabbix-proxy:10072</code>.</p>
<h4><code>ZBX_LOADMODULE</code></h4>
<p>The variable is list of comma separated loadable Zabbix modules. It works with volume <code>/var/lib/zabbix/modules</code>. The syntax of the variable is <code>dummy1.so,dummy2.so</code>.</p>
<h4><code>ZBX_DEBUGLEVEL</code></h4>
<p>The variable is used to specify debug level. By default, value is <code>3</code>. It is <code>DebugLevel</code> parameter in <code>zabbix_agentd.conf</code>. Allowed values are listed below:</p>
<ul>
<li><code>0</code> - basic information about starting and stopping of Zabbix processes;</li>
<li><code>1</code> - critical information</li>
<li><code>2</code> - error information</li>
<li><code>3</code> - warnings</li>
<li><code>4</code> - for debugging (produces lots of information)</li>
<li><code>5</code> - extended debugging (produces even more information)</li>
</ul>
<h4><code>ZBX_TIMEOUT</code></h4>
<p>The variable is used to specify timeout for processing checks. By default, value is <code>3</code>.</p>
<h4>Other variables</h4>
<p>Additionally the image allows to specify many other environment variables listed below:</p>
<pre><code>ZBX_SOURCEIP=
ZBX_ENABLEREMOTECOMMANDS=0 # Deprecated since 5.0.0
ZBX_LOGREMOTECOMMANDS=0
ZBX_HEARTBEAT_FREQUENCY=60 # Available since 6.2.0
ZBX_HOSTINTERFACE= # Available since 4.4.0
ZBX_HOSTINTERFACEITEM= # Available since 4.4.0
ZBX_STARTAGENTS=10
ZBX_HOSTNAMEITEM=system.hostname
ZBX_METADATA=
ZBX_METADATAITEM=
ZBX_REFRESHACTIVECHECKS=5
ZBX_BUFFERSEND=5
ZBX_BUFFERSIZE=100
ZBX_MAXLINESPERSECOND=20
ZBX_LISTENIP=
ZBX_LISTENPORT=10050
ZBX_LISTENBACKLOG=
ZBX_UNSAFEUSERPARAMETERS=0
ZBX_TLSCONNECT=unencrypted
ZBX_TLSACCEPT=unencrypted
ZBX_TLSCAFILE=
ZBX_TLSCA=
ZBX_TLSCRLFILE=
ZBX_TLSCRL=
ZBX_TLSSERVERCERTISSUER=
ZBX_TLSSERVERCERTSUBJECT=
ZBX_TLSCERTFILE=
ZBX_TLSCERT=
ZBX_TLSKEYFILE=
ZBX_TLSKEY=
ZBX_TLSPSKIDENTITY=
ZBX_TLSPSKFILE=
ZBX_TLSPSK=
ZBX_TLSCIPHERALL= # Available since 4.4.7
ZBX_TLSCIPHERALL13= # Available since 4.4.7
ZBX_TLSCIPHERCERT= # Available since 4.4.7
ZBX_TLSCIPHERCERT13= # Available since 4.4.7
ZBX_TLSCIPHERPSK= # Available since 4.4.7
ZBX_TLSCIPHERPSK13= # Available since 4.4.7
ZBX_DENYKEY=system.run[*] # Available since 5.0.0
ZBX_ALLOWKEY= # Available since 5.0.0
</code></pre>
<p>Default values of these variables are specified after equal sign.</p>
<p>The allowed variables are identical of parameters in official <code>zabbix_agentd.conf</code> configuration file. For example, <code>ZBX_REFRESHACTIVECHECKS</code> = <code>RefreshActiveChecks</code>.</p>
<p>Please use official documentation for <a href="https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_agentd"><code>zabbix_agentd.conf</code></a> to get more information about the variables.</p>
<h3>Allowed volumes for the Zabbix agent container</h3>
<h4><code>/etc/zabbix/zabbix_agentd.d</code></h4>
<p>The volume allows include <code>*.conf</code> files and extend Zabbix agent using <code>UserParameter</code> feature.</p>
<h4><code>/var/lib/zabbix/modules</code></h4>
<p>The volume allows load additional modules and extend Zabbix agent using <code>LoadModule</code> feature.</p>
<h4><code>/var/lib/zabbix/enc</code></h4>
<p>The volume is used to store TLS related files. These file names are specified using <code>ZBX_TLSCAFILE</code>, <code>ZBX_TLSCRLFILE</code>, <code>ZBX_TLSCERTFILE</code>, <code>ZBX_TLSKEYFILE</code> and <code>ZBX_TLSPSKFILE</code> variables. Additionally it is possible to use environment variables <code>ZBX_TLSCA</code>, <code>ZBX_TLSCRL</code>, <code>ZBX_TLSCERT</code>, <code>ZBX_TLSKEY</code> and <code>ZBX_TLSPSK</code> with plaintext values.</p>

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1,661 +0,0 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,103 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=ubuntu:resolute
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_LOADMODULEPATH=${ZABBIX_USER_HOME_DIR}/modules \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix agent" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent/conf/ ${ZABBIX_CONF_DIR}/
RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--mount=type=cache,target=/var/lib/apt/,sharing=locked \
set -eux && \
INSTALL_PKGS="bash \
ca-certificates \
tzdata \
libcares2 \
libcurl4t64 \
libldap2 \
libmodbus5 \
libpcre2-8-0 \
libssl3t64 \
zlib1g \
iputils-ping" && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
${INSTALL_PKGS} && \
groupadd \
--system \
--gid 1995 \
zabbix && \
useradd \
--system \
--comment "Zabbix monitoring system" \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/modules \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agentd -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
USER 1997
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/sbin/zabbix_agentd", "--foreground", "-c", "/etc/zabbix/zabbix_agentd.conf"]

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1,87 +0,0 @@
# syntax=docker/dockerfile:1.6
# escape=`
ARG OS_BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:ltsc2022
ARG ENTRYPOINT_BUILD_IMAGE=golang:1.26.5-windowsservercore-ltsc2022
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent-${ZBX_VERSION}
FROM ${ENTRYPOINT_BUILD_IMAGE} AS entrypoint-builder
COPY ["templates/entrypoints", "C:\\entrypoints"]
WORKDIR C:\entrypoints
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN $env:CGO_ENABLED = '0'; `
go build -buildvcs=false -trimpath -ldflags='-s -w -buildid=' `
-o C:\docker-entrypoint.exe `
./cmd/agent;
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV ZABBIX_USER_HOME_DIR="C:\zabbix" `
ZABBIX_CONF_DIR="C:\zabbix\conf"
ENV ZBX_USERPARAMETERDIR="${ZABBIX_USER_HOME_DIR}\user_scripts"
LABEL org.opencontainers.image.title="Zabbix agent" `
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" `
org.opencontainers.image.vendor="Zabbix SIA" `
org.opencontainers.image.url="https://zabbix.com/" `
org.opencontainers.image.description="Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications" `
org.opencontainers.image.licenses="AGPL v3.0" `
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" `
org.opencontainers.image.version="${ZBX_VERSION}" `
org.opencontainers.image.source="${ZBX_SOURCES}"
COPY --from=builder ["C:\\zabbix-${ZBX_VERSION}-output", "C:\\zabbix"]
COPY ["templates/config/agent_windows", "C:\\zabbix\\conf"]
COPY --from=builder ["C:\\build_deps\\pwsh", "C:\\Program Files\\PowerShell"]
COPY --from=entrypoint-builder ["C:\\docker-entrypoint.exe", "C:\\zabbix\\docker-entrypoint.exe"]
COPY ["templates/entrypoints/licenses/go-THIRD-PARTY-NOTICES.txt", "C:\\licenses\\"]
WORKDIR C:\zabbix\
USER ContainerAdministrator
SHELL ["C:\\Program Files\\PowerShell\\pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop';"]
RUN $env:PATH = [string]::Format('{0}\zabbix\sbin;{0}\zabbix\bin;{0}\Program Files\PowerShell;', $env:SystemDrive) + $env:PATH; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
[Environment]::SetEnvironmentVariable('ZABBIX_USER_HOME_DIR', $env:ZABBIX_USER_HOME_DIR, [EnvironmentVariableTarget]::Machine); `
`
Write-Host ('Verifying Zabbix agent {0} ...' -f $env:ZBX_VERSION); `
zabbix_agentd.exe -V;
RUN Set-Location -Path $env:SystemDrive\.; `
`
New-Item -Force -ItemType directory -Path $env:ZABBIX_CONF_DIR | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZABBIX_CONF_DIR\zabbix_agentd.d | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZABBIX_USER_HOME_DIR\enc | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZABBIX_USER_HOME_DIR\enc_internal | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_USERPARAMETERDIR | Out-Null; `
`
net accounts /MaxPWAge:unlimited; `
net user /add zabbix /expire:never /passwordreq:no; `
$acl = Get-Acl -Path $env:ZABBIX_USER_HOME_DIR; `
$ace = New-Object Security.AccessControl.FileSystemAccessRule ('zabbix', 'Modify', 'ContainerInherit, ObjectInherit', 'InheritOnly', 'Allow'); `
$acl.AddAccessRule($ace); `
Set-Acl -AclObject $acl -Path $env:ZABBIX_USER_HOME_DIR;
USER zabbix
EXPOSE 10050/tcp
ENTRYPOINT ["C:\\zabbix\\docker-entrypoint.exe"]
CMD ["C:\\zabbix\\sbin\\zabbix_agentd.exe", "-c", "C:\\zabbix\\conf\\zabbix_agentd.conf", "-f"]

View file

@ -1,17 +0,0 @@
**
!templates/
!templates/entrypoints/
!templates/entrypoints/go.mod
!templates/entrypoints/cmd/
!templates/entrypoints/cmd/agent/
!templates/entrypoints/cmd/agent/**
!templates/entrypoints/internal/
!templates/entrypoints/internal/agent/
!templates/entrypoints/internal/agent/**
!templates/entrypoints/internal/bootstrap/
!templates/entrypoints/internal/bootstrap/**
!templates/entrypoints/licenses/
!templates/entrypoints/licenses/go-THIRD-PARTY-NOTICES.txt
!templates/config/
!templates/config/agent_windows/
!templates/config/agent_windows/**

View file

@ -1 +0,0 @@
../README.md

View file

@ -1,243 +0,0 @@
![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png)
# What is Zabbix?
Zabbix is an enterprise-class open source distributed monitoring solution.
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
# What is Zabbix agent 2?
Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications (hard drives, memory, processor statistics etc).
# Zabbix agent 2 images
These are the only official Zabbix agent 2 Docker images. They are based on Alpine Linux v3.24, Ubuntu 26.04 (resolute), CentOS Stream 10, Oracle Linux 10, Windows 10 LTSC 2019 and Windows 11 LTSC 2022 images. The available versions of Zabbix agent 2 are:
Zabbix agent 2 6.0 (tags: alpine-6.0-latest, ubuntu-6.0-latest, ol-6.0-latest)
Zabbix agent 2 6.0.* (tags: alpine-6.0.*, ubuntu-6.0.*, ol-6.0.*, ltsc2019-6.0.*, ltsc2022-6.0.*)
Zabbix agent 2 7.0 (tags: alpine-7.0-latest, ubuntu-7.0-latest, ol-7.0-latest)
Zabbix agent 2 7.0.* (tags: alpine-7.0.*, ubuntu-7.0.*, ol-7.0.*, ltsc2019-7.0.*, ltsc2022-7.0.*)
Zabbix agent 2 7.2 (tags: alpine-7.2-latest, ubuntu-7.2-latest, ol-7.2-latest)
Zabbix agent 2 7.2.* (tags: alpine-7.2.*, ubuntu-7.2.*, ol-7.2.*, ltsc2019-7.2.*, ltsc2022-7.2.*)
Zabbix agent 2 7.4 (tags: alpine-7.4-latest, ubuntu-7.4-latest, ol-7.4-latest, alpine-latest, ubuntu-latest, ol-latest, ltsc2019-latest, ltsc2022-latest, latest)
Zabbix agent 2 7.4.* (tags: alpine-7.4.*, ubuntu-7.4.*, ol-7.4.*, ltsc2019-7.4.*, ltsc2022-7.4.*)
Zabbix agent 2 8.0 (tags: alpine-trunk, ubuntu-trunk, ol-trunk, ltsc2019-trunk, ltsc2022-trunk)
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
# How to use this image
## Start `zabbix-agent2`
Start a Zabbix agent 2 container as follows:
docker run --name some-zabbix-agent -e ZBX_HOSTNAME="some-hostname" -e ZBX_SERVER_HOST="some-zabbix-server" --init -d zabbix/zabbix-agent2:tag
Where `some-zabbix-agent2` is the name you want to assign to your container, `some-hostname` is the hostname, it is Hostname parameter in Zabbix agent 2 configuration file, `some-zabbix-server` is IP or DNS name of Zabbix server or proxy and `tag` is the tag specifying the version you want. See the list above for relevant tags, or look at the [full list of tags](https://hub.docker.com/r/zabbix/zabbix-agent2/tags/).
## Connects from Zabbix server or Zabbix proxy in other containers (Passive checks)
This image exposes the standard Zabbix agent 2 port (``10050``) to perform passive checks, so container linking makes Zabbix agent 2 instance available to Zabbix server and Zabbix proxy containers. Start your application container like this in order to link it to the Zabbix agent 2 container:
```console
$ docker run --name some-zabbix-server --link some-zabbix-agent:zabbix-agent2 --init -d zabbix/zabbix-server:latest
```
## Connect to Zabbix server or Zabbix proxy containers (Active checks)
This image supports perform active checks, so container linking makes Zabbix server and Zabbix proxy containers available to Zabbix agent 2 instance. Start your application container like this in order to link Zabbix agent 2 to Zabbix server or Zabbix proxy containers:
```console
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server --init -d zabbix/zabbix-agent2:latest
```
## Container shell access and viewing Zabbix agent 2 logs
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `zabbix-agent2` container:
```console
$ docker exec -ti some-zabbix-agent /bin/bash
```
The Zabbix agent 2 log is available through Docker's container log:
```console
$ docker logs some-zabbix-agent
```
## Privileged mode
By default, Docker containers are "unprivileged" and do not have access to the most of host resources. Zabbix agent 2 is designed to monitor system resources, to do that Zabbix agent 2 container must be privileged or you may mount some system-wide volumes. For example:
```console
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server --privileged --init -d zabbix/zabbix-agent2:latest
```
```console
$ docker run --name some-zabbix-agent --link some-zabbix-server:zabbix-server -v /dev/sdc:/dev/sdc --init -d zabbix/zabbix-agent2:latest
```
## Environment Variables
When you start the `zabbix-agent2` image, you can adjust the configuration of the Zabbix agent 2 by passing one or more environment variables on the `docker run` command line.
### `ZBX_HOSTNAME`
This variable is unique, case sensitive hostname. By default, value is `hostname` of the container. It is ``Hostname`` parameter in ``zabbix_agent2.conf``.
### `ZBX_SERVER_HOST`
This variable is IP or DNS name of Zabbix server or Zabbix proxy. By default, value is `zabbix-server`. It is ``Server`` parameter in ``zabbix_agent2.conf``. It is allowed to specify Zabbix server or Zabbix proxy port number using ``ZBX_SERVER_PORT`` variable. It make sense in case of non-default port for active checks.
### `ZBX_PASSIVE_ALLOW`
This variable is boolean (``true`` or ``false``) and enables or disables feature of passive checks. By default, value is `true`.
### `ZBX_PASSIVESERVERS`
The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent 2 container.
### `ZBX_ACTIVE_ALLOW`
This variable is boolean (``true`` or ``false``) and enables or disables feature of active checks. By default, value is `true`.
### `ZBX_ACTIVESERVERS`
The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent 2 container. You may specify port of Zabbix server or Zabbix proxy in such syntax: ``zabbix-server:10061,zabbix-proxy:10072``.
### `ZBX_DEBUGLEVEL`
The variable is used to specify debug level. By default, value is ``3``. It is ``DebugLevel`` parameter in ``zabbix_agent2.conf``. Allowed values are listed below:
- ``0`` - basic information about starting and stopping of Zabbix processes;
- ``1`` - critical information
- ``2`` - error information
- ``3`` - warnings
- ``4`` - for debugging (produces lots of information)
- ``5`` - extended debugging (produces even more information)
### `ZBX_TIMEOUT`
The variable is used to specify timeout for processing checks. By default, value is ``3``.
### Other variables
Additionally the image allows to specify many other environment variables listed below:
```
ZBX_ENABLEPERSISTENTBUFFER=false # Available since 5.0.0
ZBX_PERSISTENTBUFFERPERIOD=1h # Available since 5.0.0
ZBX_ENABLESTATUSPORT=
ZBX_SOURCEIP=
ZBX_HEARTBEAT_FREQUENCY=60 # Available since 6.2.0
ZBX_ENABLEREMOTECOMMANDS=0 # Deprecated since 5.0.0
ZBX_LOGREMOTECOMMANDS=0
ZBX_FORCEACTIVECHECKSONSTART=0 # Available since 6.0.2
ZBX_HOSTINTERFACE= # Available since 4.4.0
ZBX_HOSTINTERFACEITEM= # Available since 4.4.0
ZBX_HOSTNAMEITEM=system.hostname
ZBX_METADATA=
ZBX_METADATAITEM=
ZBX_REFRESHACTIVECHECKS=5
ZBX_BUFFERSEND=5
ZBX_BUFFERSIZE=1000
ZBX_MAXLINESPERSECOND=20
ZBX_EVENTLOGMAXLINESPERSECOND=20 # Windows only
ZBX_LISTENIP=
ZBX_LISTENPORT=10050
ZBX_PLUGINTIMEOUT=
ZBX_UNSAFEUSERPARAMETERS=0
ZBX_TLSCONNECT=unencrypted
ZBX_TLSACCEPT=unencrypted
ZBX_TLSCAFILE=
ZBX_TLSCA=
ZBX_TLSCRLFILE=
ZBX_TLSCRL=
ZBX_TLSSERVERCERTISSUER=
ZBX_TLSSERVERCERTSUBJECT=
ZBX_TLSCERTFILE=
ZBX_TLSCERT=
ZBX_TLSKEYFILE=
ZBX_TLSKEY=
ZBX_TLSPSKIDENTITY=
ZBX_TLSPSKFILE=
ZBX_TLSPSK=
ZBX_TLSCIPHERALL=
ZBX_TLSCIPHERALL13=
ZBX_TLSCIPHERCERT=
ZBX_TLSCIPHERCERT13=
ZBX_TLSCIPHERPSK=
ZBX_TLSCIPHERPSK13=
ZBX_DENYKEY=system.run[*] # Available since 5.0.0
ZBX_ALLOWKEY= # Available since 5.0.0
```
Default values of these variables are specified after equal sign.
The allowed variables are identical of parameters in official ``zabbix_agent2.conf`` configuration file. For example, ``ZBX_REFRESHACTIVECHECKS`` = ``RefreshActiveChecks``.
Please use official documentation for [``zabbix_agent2.conf``](https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_agent2) to get more information about the variables.
## Allowed volumes for the Zabbix agent 2 container
### ``/etc/zabbix/zabbix_agentd.d``
The volume allows include ``*.conf`` files and extend Zabbix agent 2 using ``UserParameter`` feature.
### ``/var/lib/zabbix/enc``
The volume is used to store TLS related files. These file names are specified using ``ZBX_TLSCAFILE``, ``ZBX_TLSCRLFILE``, ``ZBX_TLSCERTFILE``, ``ZBX_TLSKEYFILE`` and ``ZBX_TLSPSKFILE`` variables. Additionally it is possible to use environment variables ``ZBX_TLSCA``, ``ZBX_TLSCRL``, ``ZBX_TLSCERT``, ``ZBX_TLSKEY`` and ``ZBX_TLSPSK`` with plaintext values.
### ``/var/lib/zabbix/buffer``
The volume is used to store the file, where Zabbix Agent2 should keep SQLite database. To enable the feature specify ``ZBX_ENABLEPERSISTENTBUFFER=true``. Available since 5.0.0.
# The image variants
The `zabbix-agent2` images come in many flavors, each designed for a specific use case.
## `zabbix-agent2:alpine-<version>`
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
## `zabbix-agent2:ubuntu-<version>`
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
## `zabbix-agent2:ol-<version>`
Oracle Linux is an open-source operating system available under the GNU General Public License (GPLv2). Suitable for general purpose or Oracle workloads, it benefits from rigorous testing of more than 128,000 hours per day with real-world workloads and includes unique innovations such as Ksplice for zero-downtime kernel patching, DTrace for real-time diagnostics, the powerful Btrfs file system, and more.
# User Feedback
## Documentation
Documentation for this image is stored in the [`agent2/` directory](https://github.com/zabbix/zabbix-docker/tree/7.4/Dockerfiles/agent2) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/7.4/README.md) before attempting a pull request.
## Issues
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
### Known issues
Currently it is not allowed to specify ``ZBX_ALIAS`` environment variable. Please use ``/etc/zabbix/zabbix_agentd.d`` volume with additional configuration files with ``Alias`` options.
## Contributing
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
## License
Starting from Zabbix version 7.0, all subsequent Zabbix versions will be released under the GNU Affero General Public License version 3 (AGPLv3).
You can modify the relevant version and propagate such modified version under the terms of the AGPLv3 as published by the Free Software Foundation.
For additional details, including answers to common questions about the AGPLv3, see the generic FAQ from the [Free Software Foundation](http://www.fsf.org/licenses/gpl-faq.html).
Zabbix is Open Source Software, however, if you use Zabbix in a commercial context we kindly ask you to support the development of Zabbix by purchasing some level of technical support.
All previous Zabbix software versions up to 6.4 are released under the GNU General Public License version 2 (GPLv2). The formal terms of the GPLv2 and AGPLv3 can be found at http://www.fsf.org/licenses/.

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,101 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=alpine:3.24
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_PERSISTENTBUFFERFILE=$ZABBIX_USER_HOME_DIR/buffer/agent2.db \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix agent 2" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix_agent2 /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix-agent2-plugin/ /usr/sbin/zabbix-agent2-plugin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/ ${ZABBIX_CONF_DIR}/
RUN set -eux && \
INSTALL_PKGS="bash \
coreutils \
tzdata \
pcre2 \
iputils \
smartmontools \
sudo" && \
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 ${ZABBIX_USER_HOME_DIR}/ \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_CONF_DIR}/zabbix_agent2.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/buffer \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent2.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp 31999/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
USER 1997
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/sbin/zabbix_agent2", "--foreground", "-c", "/etc/zabbix/zabbix_agent2.conf"]

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,117 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=quay.io/centos/centos:stream10-minimal
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_PERSISTENTBUFFERFILE=$ZABBIX_USER_HOME_DIR/buffer/agent2.db \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix agent 2" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix_agent2 /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix-agent2-plugin/ /usr/sbin/zabbix-agent2-plugin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/ ${ZABBIX_CONF_DIR}/
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
shadow-utils \
libcurl-minimal \
openssl-libs \
pcre2 \
iputils \
smartmontools \
sudo" && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="extras-common" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
epel-release && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="baseos" \
--enablerepo="appstream" \
--enablerepo="epel" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
${INSTALL_PKGS} && \
groupadd \
--system \
--gid 1995 \
zabbix && \
useradd \
--system \
--comment "Zabbix monitoring system" \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_CONF_DIR}/zabbix_agent2.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/buffer \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent2.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp 31999/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
USER 1997
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/sbin/zabbix_agent2", "--foreground", "-c", "/etc/zabbix/zabbix_agent2.conf"]

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,116 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_PERSISTENTBUFFERFILE=$ZABBIX_USER_HOME_DIR/buffer/agent2.db \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix agent 2" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix_agent2 /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix-agent2-plugin/ /usr/sbin/zabbix-agent2-plugin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/ ${ZABBIX_CONF_DIR}/
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
libcurl \
openssl-libs \
pcre2 \
iputils \
smartmontools \
sudo" && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ol10_baseos_latest" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
oracle-epel-release-el10 && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ol10_baseos_latest" \
--enablerepo="ol10_appstream" \
--enablerepo="ol10_u1_developer_EPEL" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
${INSTALL_PKGS} && \
groupadd \
--system \
--gid 1995 \
zabbix && \
useradd \
--system \
--comment "Zabbix monitoring system" \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_CONF_DIR}/zabbix_agent2.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/buffer \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent2.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp 31999/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
USER 1997
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/sbin/zabbix_agent2", "--foreground", "-c", "/etc/zabbix/zabbix_agent2.conf"]

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,126 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=registry.access.redhat.com/ubi10/ubi-minimal:10.2
ARG MAJOR_VERSION=7.4
ARG RELEASE=12
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG RELEASE
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_PERSISTENTBUFFERFILE=$ZABBIX_USER_HOME_DIR/buffer/agent2.db \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
maintainer="alexey.pustovalov@zabbix.com" \
name="zabbix/zabbix-agent2-74" \
release="${RELEASE}" \
run="docker run --name zabbix-agent2 --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent2-74:${ZBX_VERSION}" \
summary="Zabbix agent" \
url="https://www.zabbix.com/" \
vendor="Zabbix SIA" \
version="${MAJOR_VERSION}" \
io.k8s.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
io.k8s.display-name="Zabbix Agent 2" \
io.openshift.expose-services="10050:10050" \
io.openshift.tags="zabbix,zabbix-agent" \
org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
org.label-schema.docker.cmd="docker run --name zabbix-agent2 --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent2-74:${ZBX_VERSION}" \
org.label-schema.license="AGPL v3.0" \
org.label-schema.name="zabbix-agent2-rhel" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://zabbix.com/" \
org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.label-schema.vcs-ref="${VCS_REF}" \
org.label-schema.vcs-url="${ZBX_SOURCES}" \
org.label-schema.vendor="Zabbix SIA" \
org.label-schema.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY licenses /licenses/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix_agent2 /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix-agent2-plugin/ /usr/sbin/zabbix-agent2-plugin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/ ${ZABBIX_CONF_DIR}/
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
shadow-utils \
tzdata \
libcurl-minimal \
pcre2 \
iputils \
smartmontools \
sudo" && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ubi-10-baseos-rpms" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--setopt=tsflags=nodocs \
${INSTALL_PKGS} && \
groupadd \
--system \
--gid 1995 \
zabbix && \
useradd \
--system \
--comment "Zabbix monitoring system" \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_CONF_DIR}/zabbix_agent2.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/buffer \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent2.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp 31999/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
USER 1997
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/sbin/zabbix_agent2", "--foreground", "-c", "/etc/zabbix/zabbix_agent2.conf"]

View file

@ -1,144 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=nvidia/cuda:12.9.0-base-ubi9
ARG MAJOR_VERSION=7.4
ARG RELEASE=12
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=registry.connect.redhat.com/zabbix/zabbix-agent2-74:${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG RELEASE
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_PERSISTENTBUFFERFILE=$ZABBIX_USER_HOME_DIR/buffer/agent2.db \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
maintainer="alexey.pustovalov@zabbix.com" \
name="zabbix/zabbix-agent2-74" \
release="${RELEASE}" \
run="docker run --name zabbix-agent2 --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent2-74:${ZBX_VERSION}" \
summary="Zabbix agent" \
url="https://www.zabbix.com/" \
vendor="Zabbix SIA" \
version="${MAJOR_VERSION}" \
io.k8s.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
io.k8s.display-name="Zabbix Agent 2" \
io.openshift.expose-services="10050:10050" \
io.openshift.tags="zabbix,zabbix-agent" \
org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
org.label-schema.docker.cmd="docker run --name zabbix-agent2 --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent2-74:${ZBX_VERSION}" \
org.label-schema.license="AGPL v3.0" \
org.label-schema.name="zabbix-agent2-rhel" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://zabbix.com/" \
org.label-schema.usage="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.label-schema.vcs-ref="${VCS_REF}" \
org.label-schema.vcs-url="${ZBX_SOURCES}" \
org.label-schema.vendor="Zabbix SIA" \
org.label-schema.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY licenses /licenses/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix_agent2 /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix-agent2-plugin/ /usr/sbin/zabbix-agent2-plugin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/ ${ZABBIX_CONF_DIR}/
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
shadow-utils \
libcurl-minimal \
pcre2 \
iputils \
smartmontools \
sudo" && \
dnf -y install \
--disableplugin=subscription-manager \
--disablerepo="*" \
--enablerepo="ubi-9-baseos-rpms" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--setopt=tsflags=nodocs \
${INSTALL_PKGS} && \
dnf -y update \
--disableplugin=subscription-manager \
--disablerepo="*" \
--enablerepo="ubi-9-baseos-rpms" \
--setopt=install_weak_deps=0 \
--best \
--setopt=tsflags=nodocs \
tzdata && \
dnf -y reinstall \
--disableplugin=subscription-manager \
--disablerepo="*" \
--enablerepo="ubi-9-baseos-rpms" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--setopt=tsflags=nodocs \
tzdata && \
groupadd \
--system \
--gid 1995 \
zabbix && \
useradd \
--system \
--comment "Zabbix monitoring system" \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
ln -s /usr/lib64/libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_CONF_DIR}/zabbix_agent2.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/buffer \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent2.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp 31999/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
USER 1997
CMD ["/usr/sbin/zabbix_agent2", "--foreground", "-c", "/etc/zabbix/zabbix_agent2.conf"]

View file

@ -1,142 +0,0 @@
<h2>What is Zabbix?</h2>
<p>Zabbix is an enterprise-class open source distributed monitoring solution.</p>
<p>Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.</p>
<p>For more information and related downloads for Zabbix components, please visit <a href="https://zabbix.com">zabbix.com</a></p>
<h2>What is Zabbix agent 2?</h2>
<p>Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications (hard drives, memory, processor statistics etc).</p>
<h2>Zabbix agent 2 images</h2>
<p>Images are updated when new releases are published.</p>
<h2>How to use this image</h2>
<h3>Start <code>zabbix-agent2</code></h3>
<p>Start a Zabbix agent 2 container as follows:</p>
<pre><code>podman run \
--name some-zabbix-agent \
-e ZBX_HOSTNAME="some-hostname" \
-e ZBX_SERVER_HOST="some-zabbix-server" \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent2-74:tag
</code></pre>
<p>Where <code>some-zabbix-agent2</code> is the name you want to assign to your container, <code>some-hostname</code> is the hostname, it is Hostname parameter in Zabbix agent 2 configuration file, <code>some-zabbix-server</code> is IP or DNS name of Zabbix server or proxy and <code>tag</code> is the tag specifying the version you want.</p>
<h3>Connects from Zabbix server or Zabbix proxy in other containers (Passive checks)</h3>
<p>This image exposes the standard Zabbix agent 2 port (<code>10050</code>) to perform passive checks, so container linking makes Zabbix agent 2 instance available to Zabbix server and Zabbix proxy containers. Start your application container like this in order to link it to the Zabbix agent 2 container:</p>
<pre><code>$ podman run \
--name some-zabbix-server \
--link some-zabbix-agent:zabbix-agent2 \
--init \
-d zabbix/zabbix-server:latest
</code></pre>
<h3>Connect to Zabbix server or Zabbix proxy containers (Active checks)</h3>
<p>This image supports perform active checks, so container linking makes Zabbix server and Zabbix proxy containers available to Zabbix agent 2 instance. Start your application container like this in order to link Zabbix agent 2 to Zabbix server or Zabbix proxy containers:</p>
<pre><code>$ podman run \
--name some-zabbix-agent \
--link some-zabbix-server:zabbix-server \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent2-74:latest
</code></pre>
<h3>Container shell access and viewing Zabbix agent 2 logs</h3>
<p>The <code>podman exec</code> command allows you to run commands inside a Podman container. The following command line will give you a bash shell inside your <code>zabbix-agent2</code> container:</p>
<pre><code>$ podman exec -ti some-zabbix-agent /bin/bash
</code></pre>
<p>The Zabbix agent 2 log is available through Podman's container log:</p>
<pre><code>$ podman logs some-zabbix-agent
</code></pre>
<h3>Privileged mode</h3>
<p>By default, Podman containers are "unprivileged" and do not have access to the most of host resources. Zabbix agent 2 is designed to monitor system resources, to do that Zabbix agent 2 container must be privileged or you may mount some system-wide volumes. For example:</p>
<pre><code>$ podman run \
--name some-zabbix-agent \
--link some-zabbix-server:zabbix-server \
--privileged \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent2-74:latest
</code></pre>
<pre><code>$ podman run \
--name some-zabbix-agent \
--link some-zabbix-server:zabbix-server \
-v /dev/sdc:/dev/sdc \
--init \
-d registry.connect.redhat.com/zabbix/zabbix-agent2-74:latest
</code></pre>
<h3>Environment Variables</h3>
<p>When you start the <code>zabbix-agent2</code> image, you can adjust the configuration of the Zabbix agent 2 by passing one or more environment variables on the <code>podman run</code> command line.</p>
<h4><code>ZBX_HOSTNAME</code></h4>
<p>This variable is unique, case sensitive hostname. By default, value is <code>hostname</code> of the container. It is <code>Hostname</code> parameter in <code>zabbix_agent2.conf</code>.</p>
<h4><code>ZBX_SERVER_HOST</code></h4>
<p>This variable is IP or DNS name of Zabbix server or Zabbix proxy. By default, value is <code>zabbix-server</code>. It is <code>Server</code> parameter in <code>zabbix_agent2.conf</code>. It is allowed to specify Zabbix server or Zabbix proxy port number using <code>ZBX_SERVER_PORT</code> variable. It make sense in case of non-default port for active checks.</p>
<h4><code>ZBX_PASSIVE_ALLOW</code></h4>
<p>This variable is boolean (<code>true</code> or <code>false</code>) and enables or disables feature of passive checks. By default, value is <code>true</code>.</p>
<h4><code>ZBX_PASSIVESERVERS</code></h4>
<p>The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent 2 container.</p>
<h4><code>ZBX_ACTIVE_ALLOW</code></h4>
<p>This variable is boolean (<code>true</code> or <code>false</code>) and enables or disables feature of active checks. By default, value is <code>true</code>.</p>
<h4><code>ZBX_ACTIVESERVERS</code></h4>
<p>The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent 2 container. You may specify port of Zabbix server or Zabbix proxy in such syntax: <code>zabbix-server:10061,zabbix-proxy:10072</code>.</p>
<h4><code>ZBX_DEBUGLEVEL</code></h4>
<p>The variable is used to specify debug level. By default, value is <code>3</code>. It is <code>DebugLevel</code> parameter in <code>zabbix_agent2.conf</code>. Allowed values are listed below:</p>
<ul>
<li><code>0</code> - basic information about starting and stopping of Zabbix processes;</li>
<li><code>1</code> - critical information</li>
<li><code>2</code> - error information</li>
<li><code>3</code> - warnings</li>
<li><code>4</code> - for debugging (produces lots of information)</li>
<li><code>5</code> - extended debugging (produces even more information)</li>
</ul>
<h4><code>ZBX_TIMEOUT</code></h4>
<p>The variable is used to specify timeout for processing checks. By default, value is <code>3</code>.</p>
<h4>Other variables</h4>
<p>Additionally the image allows to specify many other environment variables listed below:</p>
<pre><code>ZBX_ENABLEPERSISTENTBUFFER=false # Available since 5.0.0
ZBX_PERSISTENTBUFFERPERIOD=1h # Available since 5.0.0
ZBX_ENABLESTATUSPORT=
ZBX_SOURCEIP=
ZBX_HEARTBEAT_FREQUENCY=60 # Available since 6.2.0
ZBX_ENABLEREMOTECOMMANDS=0 # Deprecated since 5.0.0
ZBX_LOGREMOTECOMMANDS=0
ZBX_FORCEACTIVECHECKSONSTART=0 # Available since 6.0.2
ZBX_HOSTINTERFACE= # Available since 4.4.0
ZBX_HOSTINTERFACEITEM= # Available since 4.4.0
ZBX_HOSTNAMEITEM=system.hostname
ZBX_METADATA=
ZBX_METADATAITEM=
ZBX_REFRESHACTIVECHECKS=5
ZBX_BUFFERSEND=5
ZBX_BUFFERSIZE=1000
ZBX_MAXLINESPERSECOND=20
ZBX_EVENTLOGMAXLINESPERSECOND=20 # Windows only
ZBX_LISTENIP=
ZBX_LISTENPORT=10050
ZBX_PLUGINTIMEOUT=
ZBX_UNSAFEUSERPARAMETERS=0
ZBX_TLSCONNECT=unencrypted
ZBX_TLSACCEPT=unencrypted
ZBX_TLSCAFILE=
ZBX_TLSCA=
ZBX_TLSCRLFILE=
ZBX_TLSCRL=
ZBX_TLSSERVERCERTISSUER=
ZBX_TLSSERVERCERTSUBJECT=
ZBX_TLSCERTFILE=
ZBX_TLSCERT=
ZBX_TLSKEYFILE=
ZBX_TLSKEY=
ZBX_TLSPSKIDENTITY=
ZBX_TLSPSKFILE=
ZBX_TLSPSK=
ZBX_TLSCIPHERALL=
ZBX_TLSCIPHERALL13=
ZBX_TLSCIPHERCERT=
ZBX_TLSCIPHERCERT13=
ZBX_TLSCIPHERPSK=
ZBX_TLSCIPHERPSK13=
ZBX_DENYKEY=system.run[*] # Available since 5.0.0
ZBX_ALLOWKEY= # Available since 5.0.0
</code></pre>
<p>Default values of these variables are specified after equal sign.</p>
<p>The allowed variables are identical of parameters in official <code>zabbix_agent2.conf</code> configuration file. For example, <code>ZBX_REFRESHACTIVECHECKS</code> = <code>RefreshActiveChecks</code>.</p>
<p>Please use official documentation for <a href="https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_agent2"><code>zabbix_agent2.conf</code></a> to get more information about the variables.</p>
<h3>Allowed volumes for the Zabbix agent 2 container</h3>
<h4><code>/etc/zabbix/zabbix_agentd.d</code></h4>
<p>The volume allows include <code>*.conf</code> files and extend Zabbix agent 2 using <code>UserParameter</code> feature.</p>
<h4><code>/var/lib/zabbix/enc</code></h4>
<p>The volume is used to store TLS related files. These file names are specified using <code>ZBX_TLSCAFILE</code>, <code>ZBX_TLSCRLFILE</code>, <code>ZBX_TLSCERTFILE</code>, <code>ZBX_TLSKEYFILE</code> and <code>ZBX_TLSPSKFILE</code> variables. Additionally it is possible to use environment variables <code>ZBX_TLSCA</code>, <code>ZBX_TLSCRL</code>, <code>ZBX_TLSCERT</code>, <code>ZBX_TLSKEY</code> and <code>ZBX_TLSPSK</code> with plaintext values.</p>
<h4><code>/var/lib/zabbix/buffer</code></h4>
<p>The volume is used to store the file, where Zabbix Agent2 should keep SQLite database. To enable the feature specify <code>ZBX_ENABLEPERSISTENTBUFFER=true</code>. Available since 5.0.0.</p>

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1,661 +0,0 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,104 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=ubuntu:resolute
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
ZBX_SOURCES=${ZBX_SOURCES} \
ZABBIX_USER_HOME_DIR=/var/lib/zabbix \
ZABBIX_CONF_DIR=/etc/zabbix
ENV ZBX_PERSISTENTBUFFERFILE=$ZABBIX_USER_HOME_DIR/buffer/agent2.db \
ZBX_USERPARAMETERDIR=${ZABBIX_USER_HOME_DIR}/user_scripts
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix agent 2" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
STOPSIGNAL SIGTERM
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix_agent2 /usr/sbin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/zabbix-agent2-plugin/ /usr/sbin/zabbix-agent2-plugin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_get /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/general/bin/zabbix_sender /usr/bin/
COPY --from=builder /tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/ ${ZABBIX_CONF_DIR}/
RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--mount=type=cache,target=/var/lib/apt/,sharing=locked \
set -eux && \
INSTALL_PKGS="bash \
ca-certificates \
tzdata \
libcurl4t64 \
libpcre2-8-0 \
libssl3t64 \
iputils-ping \
smartmontools \
sudo" && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
${INSTALL_PKGS} && \
groupadd \
--system \
--gid 1995 \
zabbix && \
useradd \
--system \
--comment "Zabbix monitoring system" \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
mkdir -p ${ZABBIX_CONF_DIR} \
${ZABBIX_CONF_DIR}/zabbix_agentd.d \
${ZABBIX_CONF_DIR}/zabbix_agent2.d \
${ZABBIX_USER_HOME_DIR} \
${ZABBIX_USER_HOME_DIR}/enc \
${ZABBIX_USER_HOME_DIR}/enc_internal \
${ZABBIX_USER_HOME_DIR}/buffer \
${ZBX_USERPARAMETERDIR} && \
FIX_PERM_LIST="\
${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/" && \
chown --quiet -R zabbix:0 ${FIX_PERM_LIST} && \
chmod -R g=u ${FIX_PERM_LIST} && \
chown --quiet zabbix:0 ${ZABBIX_CONF_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
RUN --mount=from=entrypoints,target=/tmp/entrypoints,ro \
set -eux && \
install -d /usr/lib/docker-entrypoint && \
install -m 0755 /tmp/entrypoints/agent2.sh /usr/bin/docker-entrypoint.sh && \
install -m 0644 /tmp/entrypoints/lib/*.sh /usr/lib/docker-entrypoint/
EXPOSE 10050/tcp 31999/tcp
WORKDIR ${ZABBIX_USER_HOME_DIR}
USER 1997
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/sbin/zabbix_agent2", "--foreground", "-c", "/etc/zabbix/zabbix_agent2.conf"]

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1,90 +0,0 @@
# syntax=docker/dockerfile:1.6
# escape=`
ARG OS_BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:ltsc2022
ARG ENTRYPOINT_BUILD_IMAGE=golang:1.26.5-windowsservercore-ltsc2022
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent2-${ZBX_VERSION}
FROM ${ENTRYPOINT_BUILD_IMAGE} AS entrypoint-builder
COPY ["templates/entrypoints", "C:\\entrypoints"]
WORKDIR C:\entrypoints
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN $env:CGO_ENABLED = '0'; `
go build -buildvcs=false -trimpath -ldflags='-s -w -buildid=' `
-o C:\docker-entrypoint.exe `
./cmd/agent2;
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ENV ZABBIX_USER_HOME_DIR="C:\zabbix" `
ZABBIX_CONF_DIR="C:\zabbix\conf"
ENV ZBX_PERSISTENTBUFFERFILE="$ZABBIX_USER_HOME_DIR\buffer\agent2.db" `
ZBX_USERPARAMETERDIR="${ZABBIX_USER_HOME_DIR}\user_scripts"
LABEL org.opencontainers.image.title="Zabbix agent 2" `
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" `
org.opencontainers.image.vendor="Zabbix SIA" `
org.opencontainers.image.url="https://zabbix.com/" `
org.opencontainers.image.description="Zabbix agent 2 is deployed on a monitoring target to actively monitor local resources and applications" `
org.opencontainers.image.licenses="AGPL v3.0" `
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" `
org.opencontainers.image.version="${ZBX_VERSION}" `
org.opencontainers.image.source="${ZBX_SOURCES}"
COPY --from=builder ["C:\\zabbix-${ZBX_VERSION}-output", "C:\\zabbix"]
COPY ["templates/config/agent2_windows", "C:\\zabbix\\conf"]
COPY --from=builder ["C:\\build_deps\\pwsh", "C:\\Program Files\\PowerShell"]
COPY --from=entrypoint-builder ["C:\\docker-entrypoint.exe", "C:\\zabbix\\docker-entrypoint.exe"]
COPY ["templates/entrypoints/licenses/go-THIRD-PARTY-NOTICES.txt", "C:\\licenses\\"]
WORKDIR C:\zabbix\
USER ContainerAdministrator
SHELL ["C:\\Program Files\\PowerShell\\pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop';"]
RUN $env:PATH = [string]::Format('{0}\zabbix\sbin;{0}\zabbix\bin;{0}\Program Files\PowerShell;', $env:SystemDrive) + $env:PATH; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
[Environment]::SetEnvironmentVariable('ZABBIX_USER_HOME_DIR', $env:ZABBIX_USER_HOME_DIR, [EnvironmentVariableTarget]::Machine); `
`
Write-Host ('Verifying Zabbix agent 2 {0} ...' -f $env:ZBX_VERSION); `
zabbix_agent2.exe -V;
RUN Set-Location -Path $env:SystemDrive\.; `
`
New-Item -Force -ItemType directory -Path $env:ZABBIX_CONF_DIR | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZABBIX_CONF_DIR\zabbix_agentd.d | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZABBIX_CONF_DIR\zabbix_agent2.d | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZABBIX_USER_HOME_DIR\enc | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZABBIX_USER_HOME_DIR\enc_internal | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZABBIX_USER_HOME_DIR\buffer | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_USERPARAMETERDIR | Out-Null; `
`
net accounts /MaxPWAge:unlimited; `
net user /add zabbix /expire:never /passwordreq:no; `
$acl = Get-Acl -Path $env:ZABBIX_USER_HOME_DIR; `
$ace = New-Object Security.AccessControl.FileSystemAccessRule ('zabbix', 'Modify', 'ContainerInherit, ObjectInherit', 'InheritOnly', 'Allow'); `
$acl.AddAccessRule($ace); `
Set-Acl -AclObject $acl -Path $env:ZABBIX_USER_HOME_DIR;
USER zabbix
EXPOSE 10050/tcp 31999/tcp
ENTRYPOINT ["C:\\zabbix\\docker-entrypoint.exe"]
CMD ["C:\\zabbix\\sbin\\zabbix_agent2.exe", "-c", "C:\\zabbix\\conf\\zabbix_agent2.conf", "-f"]

View file

@ -1,17 +0,0 @@
**
!templates/
!templates/entrypoints/
!templates/entrypoints/go.mod
!templates/entrypoints/cmd/
!templates/entrypoints/cmd/agent2/
!templates/entrypoints/cmd/agent2/**
!templates/entrypoints/internal/
!templates/entrypoints/internal/agent/
!templates/entrypoints/internal/agent/**
!templates/entrypoints/internal/bootstrap/
!templates/entrypoints/internal/bootstrap/**
!templates/entrypoints/licenses/
!templates/entrypoints/licenses/go-THIRD-PARTY-NOTICES.txt
!templates/config/
!templates/config/agent2_windows/
!templates/config/agent2_windows/**

View file

@ -1 +0,0 @@
../README.md

View file

@ -1,80 +0,0 @@
![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png)
# What is Zabbix?
Zabbix is an enterprise-class open source distributed monitoring solution.
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
# What is Zabbix build base?
Zabbix build base image is prepared build environment for building Zabbix components. It contains all required packages, binaries and tools.
# Zabbix build base images
These are the only official Zabbix build base Docker images. They are based on Alpine Linux v3.24, Ubuntu 26.04 (resolute), CentOS Stream 10 and Oracle Linux 10 images. The available versions of the image are:
Zabbix build base 6.0 (tags: alpine-6.0-latest, ubuntu-6.0-latest, ol-6.0-latest)
Zabbix build base 6.0.* (tags: alpine-6.0.*, ubuntu-6.0.*, ol-6.0.*)
Zabbix build base 7.0 (tags: alpine-7.0-latest, ubuntu-7.0-latest, ol-7.0-latest)
Zabbix build base 7.0.* (tags: alpine-7.0.*, ubuntu-7.0.*, ol-7.0.*, ltsc2019-7.0.*, ltsc2022-7.0.*)
Zabbix build base 7.2 (tags: alpine-7.2-latest, ubuntu-7.2-latest, ol-7.2-latest)
Zabbix build base 7.2.* (tags: alpine-7.2.*, ubuntu-7.2.*, ol-7.2.*, ltsc2019-7.2.*, ltsc2022-7.2.*)
Zabbix build base 7.4 (tags: alpine-7.4-latest, ubuntu-7.4-latest, ol-7.4-latest, alpine-latest, ubuntu-latest, ol-latest, latest)
Zabbix build base 7.4.* (tags: alpine-7.4.*, ubuntu-7.4.*, ol-7.4.*, ltsc2019-7.4.*, ltsc2022-7.4.*)
Zabbix build base 8.0 (tags: alpine-trunk, ubuntu-trunk, ol-trunk, ltsc2019-trunk, ltsc2022-trunk)
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
# How to use this image
The image is required to build Zabbix components. It is base image for [MySQL](https://github.com/zabbix/zabbix-docker/tree/7.4/Dockerfiles/build-mysql), [PostgreSQL](https://github.com/zabbix/zabbix-docker/tree/7.4/Dockerfiles/build-pgsql) and [SQLite3](https://github.com/zabbix/zabbix-docker/tree/7.4/Dockerfiles/build-sqlite3) base images. While the image contains only required packages, MySQL, PostgreSQL and SQLite3 base images compile Zabbix component and prepare them for usage.
# The image variants
The `zabbix-build-base` images come in many flavors, each designed for a specific use case.
## `zabbix-build-base:alpine-<version>`
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
## `zabbix-build-base:ubuntu-<version>`
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
## `zabbix-build-base:ol-<version>`
Oracle Linux is an open-source operating system available under the GNU General Public License (GPLv2). Suitable for general purpose or Oracle workloads, it benefits from rigorous testing of more than 128,000 hours per day with real-world workloads and includes unique innovations such as Ksplice for zero-downtime kernel patching, DTrace for real-time diagnostics, the powerful Btrfs file system, and more.
# User Feedback
## Documentation
Documentation for this image is stored in the [`build-base/` directory](https://github.com/zabbix/zabbix-docker/tree/7.4/Dockerfiles/build-base) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/7.4/README.md) before attempting a pull request.
## Issues
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
### Known issues
## Contributing
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
## License
Starting from Zabbix version 7.0, all subsequent Zabbix versions will be released under the GNU Affero General Public License version 3 (AGPLv3).
You can modify the relevant version and propagate such modified version under the terms of the AGPLv3 as published by the Free Software Foundation.
For additional details, including answers to common questions about the AGPLv3, see the generic FAQ from the [Free Software Foundation](http://www.fsf.org/licenses/gpl-faq.html).
Zabbix is Open Source Software, however, if you use Zabbix in a commercial context we kindly ask you to support the development of Zabbix by purchasing some level of technical support.
All previous Zabbix software versions up to 6.4 are released under the GNU General Public License version 2 (GPLv2). The formal terms of the GPLv2 and AGPLv3 can be found at http://www.fsf.org/licenses/.

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,65 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=alpine:3.24
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
JAVA_HOME=/usr/lib/jvm/default-jvm \
GOPATH=/root/go \
GOCACHE=/root/.cache/go-build \
GOMODCACHE=/root/go/pkg/mod \
GOTELEMETRY=off \
GOFLAGS=-buildvcs=false
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix images" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.title="Zabbix build base" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
RUN set -eux && \
ARCH_SUFFIX="$(apk --print-arch)"; \
case "$ARCH_SUFFIX" in \
riscv64) openjdk_packages='openjdk21 openjdk21-jre-headless' ;; \
*) openjdk_packages='openjdk21 openjdk21-jre-headless' ;; \
esac; \
INSTALL_PKGS="bash \
coreutils \
curl \
autoconf \
automake \
make \
g++ \
go \
linux-headers \
$openjdk_packages \
gettext \
git \
patch \
c-ares-dev \
curl-dev \
libevent-dev \
libmodbus-dev \
libpq-dev \
libssh-dev \
libxml2-dev \
mysql-dev \
net-snmp-dev \
openipmi-dev \
openldap-dev \
openssl-dev \
pcre2-dev \
sqlite-dev \
unixodbc-dev \
zlib-dev" && \
apk add \
--no-cache \
--clean-protected \
${INSTALL_PKGS} && \
go telemetry off

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,74 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=quay.io/centos/centos:stream10-minimal
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
GOPATH=/root/go \
GOCACHE=/root/.cache/go-build \
GOMODCACHE=/root/go/pkg/mod \
GOTELEMETRY=off \
GOFLAGS=-buildvcs=false
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix images" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.title="Zabbix build base" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
autoconf \
automake \
make \
gcc \
go-toolset \
java-21-openjdk-devel \
gettext \
git \
patch \
c-ares-devel \
libcurl-devel \
libevent-devel \
libmodbus-devel \
libssh-devel \
libxml2-devel \
mysql8.4-devel \
net-snmp-devel \
OpenIPMI-devel \
openldap-devel \
openssl-devel \
pcre2-devel \
postgresql18-private-devel \
postgresql18-server-devel \
sqlite-devel \
unixODBC-devel \
zlib-devel" && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="extras-common" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
epel-release && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="baseos" \
--enablerepo="appstream" \
--enablerepo="crb" \
--enablerepo="epel" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
${INSTALL_PKGS} && \
go telemetry off

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,74 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
GOPATH=/root/go \
GOCACHE=/root/.cache/go-build \
GOMODCACHE=/root/go/pkg/mod \
GOTELEMETRY=off \
GOFLAGS=-buildvcs=false
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix images" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.title="Zabbix build base" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
autoconf \
automake \
make \
gcc \
go-toolset \
java-21-openjdk-devel \
gettext \
git \
patch \
c-ares-devel \
libcurl-devel \
libevent-devel \
libmodbus-devel \
libssh-devel \
libxml2-devel \
mysql8.4-devel \
net-snmp-devel \
OpenIPMI-devel \
openldap-devel \
openssl-devel \
pcre2-devel \
postgresql18-private-devel \
postgresql18-server-devel \
sqlite-devel \
unixODBC-devel \
zlib-devel" && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ol10_baseos_latest" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
oracle-epel-release-el10 && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ol10_baseos_latest" \
--enablerepo="ol10_appstream" \
--enablerepo="ol10_codeready_builder" \
--enablerepo="ol10_u1_developer_EPEL" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs \
${INSTALL_PKGS} && \
go telemetry off

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,86 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=registry.access.redhat.com/ubi10/ubi-minimal:10.2
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION=7.4
ARG RELEASE=12
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
GOPATH=/root/go \
GOCACHE=/root/.cache/go-build \
GOMODCACHE=/root/go/pkg/mod \
GOTELEMETRY=off \
GOFLAGS=-buildvcs=false
LABEL description="Prepared environment to build Zabbix components" \
maintainer="alexey.pustovalov@zabbix.com" \
name="zabbix/zabbix-build-base-74" \
release="${RELEASE}" \
summary="Zabbix build base" \
url="https://www.zabbix.com/" \
vendor="Zabbix SIA" \
version="${MAJOR_VERSION}" \
io.k8s.description="Prepared environment to build Zabbix components" \
io.k8s.display-name="Zabbix build base" \
io.openshift.expose-services="" \
io.openshift.tags="zabbix,build" \
org.label-schema.description="Prepared environment to build Zabbix components" \
org.label-schema.license="AGPL v3.0" \
org.label-schema.name="zabbix-build-base-rhel" \
org.label-schema.url="https://zabbix.com/" \
org.label-schema.vcs-ref="${VCS_REF}" \
org.label-schema.vendor="Zabbix SIA"
COPY licenses /licenses/
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
# --mount=type=bind,target=/run/secrets/,src=secrets/ \
set -eux && \
INSTALL_PKGS="bash \
autoconf \
automake \
make \
gcc \
go-toolset \
java-21-openjdk-devel \
gettext \
git \
patch \
c-ares-devel \
libcurl-devel \
libevent-devel \
libmodbus-devel \
libssh-devel \
libxml2-devel \
mysql8.4-devel \
net-snmp-devel \
OpenIPMI-devel \
openldap-devel \
openssl-devel \
pcre2-devel \
postgresql18-private-devel \
postgresql18-server-devel \
sqlite-devel \
unixODBC-devel \
zlib-devel" && \
curl --tlsv1.2 -sSf -L https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm -o /tmp/epel-release-latest-10.noarch.rpm && \
rpm -ivh /tmp/epel-release-latest-10.noarch.rpm && \
rm -rf /tmp/epel-release-latest-10.noarch.rpm && \
ARCH_SUFFIX="$(arch)"; \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ubi-10-baseos-rpms" \
--enablerepo="ubi-10-appstream-rpms" \
--enablerepo="rhel-10-for-$ARCH_SUFFIX-baseos-rpms" \
--enablerepo="rhel-10-for-$ARCH_SUFFIX-appstream-rpms" \
--enablerepo="codeready-builder-for-rhel-10-$ARCH_SUFFIX-rpms" \
--enablerepo="epel" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--setopt=tsflags=nodocs \
${INSTALL_PKGS} && \
go telemetry off

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1,661 +0,0 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,63 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG OS_BASE_IMAGE=ubuntu:resolute
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
PATH=/usr/lib/go-1.26/bin:$PATH \
GOPATH=/root/go \
GOCACHE=/root/.cache/go-build \
GOMODCACHE=/root/go/pkg/mod \
GOTELEMETRY=off \
GOFLAGS=-buildvcs=false
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix images" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.title="Zabbix build base" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--mount=type=cache,target=/var/lib/apt/,sharing=locked \
set -eux && \
INSTALL_PKGS="bash \
curl \
autoconf \
automake \
make \
pkg-config \
binutils \
gcc \
golang-1.26 \
openjdk-21-jdk-headless \
gettext \
git \
patch \
unzip \
libc-ares-dev \
libc6-dev \
libcurl4-openssl-dev \
libevent-dev \
libldap2-dev \
libmodbus-dev \
libmysqlclient-dev \
libopenipmi-dev \
libpcre2-dev \
libpq-dev \
libsnmp-dev \
libsqlite3-dev \
libssh-dev \
libxml2-dev \
unixodbc-dev \
zlib1g-dev" && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
${INSTALL_PKGS} && \
go telemetry off

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1,148 +0,0 @@
cmake_minimum_required(VERSION 3.16)
project(libmodbus_win C)
option(MODBUS_ENABLE_RTU "Build RTU backend (modbus-rtu.c)" ON)
option(MODBUS_ENABLE_TCP "Build TCP backend (modbus-tcp.c)" ON)
option(MODBUS_FIX_MSVC_SOCKOPT_WARNINGS "Fix MSVC winsock C4133 warnings" ON)
set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
# --- 1) Prepare shim include dir (build-only includes live here) ---
set(SHIM_INC_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")
file(MAKE_DIRECTORY "${SHIM_INC_DIR}")
# We expect config.h to exist in ${SRC_DIR}/config.h (you generate it via src/win32/configure.js)
if(NOT EXISTS "${SRC_DIR}/win32/config.h")
message(FATAL_ERROR
"config.h not found at ${SRC_DIR}/win32/config.h. "
"Run src/win32/configure.js and copy config.h into src/ before configuring with CMake.")
endif()
# --- 2) Generate shim modbus.h (static-friendly MODBUS_API) ---
file(READ "${SRC_DIR}/modbus.h" MODBUS_H_TXT)
set(MODBUS_API_BLOCK
"#if defined(_MSC_VER)
# if defined(DLLBUILD)
/* define DLLBUILD when building the DLL */
# define MODBUS_API __declspec(dllexport)
# else
# define MODBUS_API __declspec(dllimport)
# endif
#else
# define MODBUS_API
#endif")
set(MODBUS_API_BLOCK_REPL
"#if defined(_MSC_VER)
/* Static library: do NOT use dllimport/dllexport in public headers */
# if defined(DLLBUILD)
# define MODBUS_API __declspec(dllexport)
# else
# define MODBUS_API
# endif
#else
# define MODBUS_API
#endif")
string(REPLACE "${MODBUS_API_BLOCK}" "${MODBUS_API_BLOCK_REPL}" MODBUS_H_TXT "${MODBUS_H_TXT}")
file(WRITE "${SHIM_INC_DIR}/modbus.h" "${MODBUS_H_TXT}")
# Copy remaining headers needed to compile (build-only set includes private/config)
file(COPY "${SRC_DIR}/modbus-tcp.h" DESTINATION "${SHIM_INC_DIR}")
file(COPY "${SRC_DIR}/modbus-rtu.h" DESTINATION "${SHIM_INC_DIR}")
file(COPY "${SRC_DIR}/modbus-version.h" DESTINATION "${SHIM_INC_DIR}")
# Build-only headers required by .c files
file(COPY "${SRC_DIR}/win32/config.h" DESTINATION "${SHIM_INC_DIR}")
file(COPY "${SRC_DIR}/modbus-private.h" DESTINATION "${SHIM_INC_DIR}")
file(COPY "${SRC_DIR}/modbus-tcp-private.h" DESTINATION "${SHIM_INC_DIR}")
file(COPY "${SRC_DIR}/modbus-rtu-private.h" DESTINATION "${SHIM_INC_DIR}")
# --- 3) Generate shim sources (do not modify upstream sources on disk) ---
set(SHIM_SRC_DIR "${CMAKE_CURRENT_BINARY_DIR}/shim_src")
file(MAKE_DIRECTORY "${SHIM_SRC_DIR}")
function(make_shim_source in_file out_file)
file(READ "${in_file}" TXT)
# Force includes via include paths (so our shim headers win)
string(REPLACE "#include \"modbus.h\"" "#include <modbus.h>" TXT "${TXT}")
string(REPLACE "#include \"modbus-tcp.h\"" "#include <modbus-tcp.h>" TXT "${TXT}")
string(REPLACE "#include \"modbus-rtu.h\"" "#include <modbus-rtu.h>" TXT "${TXT}")
string(REPLACE "#include \"modbus-version.h\"" "#include <modbus-version.h>" TXT "${TXT}")
# Some files include private/config with quotes; route those too
string(REPLACE "#include \"config.h\"" "#include <config.h>" TXT "${TXT}")
string(REPLACE "#include \"modbus-private.h\"" "#include <modbus-private.h>" TXT "${TXT}")
string(REPLACE "#include \"modbus-tcp-private.h\"" "#include <modbus-tcp-private.h>" TXT "${TXT}")
string(REPLACE "#include \"modbus-rtu-private.h\"" "#include <modbus-rtu-private.h>" TXT "${TXT}")
# Optional: silence MSVC winsock setsockopt warnings (C4133)
# On Windows setsockopt expects const char* optval; libmodbus passes &int.
if (MSVC AND MODBUS_FIX_MSVC_SOCKOPT_WARNINGS)
string(REPLACE ", &option, sizeof(int))" ", (const char*)&option, sizeof(int))" TXT "${TXT}")
endif()
file(WRITE "${out_file}" "${TXT}")
endfunction()
# Base sources
make_shim_source("${SRC_DIR}/modbus.c" "${SHIM_SRC_DIR}/modbus.c")
make_shim_source("${SRC_DIR}/modbus-data.c" "${SHIM_SRC_DIR}/modbus-data.c")
set(MODBUS_SOURCES
"${SHIM_SRC_DIR}/modbus.c"
"${SHIM_SRC_DIR}/modbus-data.c"
)
if(MODBUS_ENABLE_TCP)
make_shim_source("${SRC_DIR}/modbus-tcp.c" "${SHIM_SRC_DIR}/modbus-tcp.c")
list(APPEND MODBUS_SOURCES "${SHIM_SRC_DIR}/modbus-tcp.c")
endif()
if(MODBUS_ENABLE_RTU)
make_shim_source("${SRC_DIR}/modbus-rtu.c" "${SHIM_SRC_DIR}/modbus-rtu.c")
list(APPEND MODBUS_SOURCES "${SHIM_SRC_DIR}/modbus-rtu.c")
endif()
add_library(modbus STATIC ${MODBUS_SOURCES})
# --- MSVC: silence WinSock signature warning (setsockopt wants const char*) ---
if (MSVC)
target_compile_options(modbus PRIVATE /wd4133)
endif()
# Use shim headers for build + consumers (PUBLIC), but we will INSTALL only public headers explicitly
target_include_directories(modbus
PUBLIC
"${SHIM_INC_DIR}"
)
if (WIN32)
target_link_libraries(modbus PUBLIC ws2_32)
endif()
# --- Install: only public headers (no config.h, no *-private.h) ---
include(GNUInstallDirs)
install(TARGETS modbus
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
set(PUBLIC_HEADERS
"${SHIM_INC_DIR}/modbus.h"
"${SHIM_INC_DIR}/modbus-version.h"
)
if(MODBUS_ENABLE_TCP)
list(APPEND PUBLIC_HEADERS "${SHIM_INC_DIR}/modbus-tcp.h")
endif()
if(MODBUS_ENABLE_RTU)
list(APPEND PUBLIC_HEADERS "${SHIM_INC_DIR}/modbus-rtu.h")
endif()
install(FILES ${PUBLIC_HEADERS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)

View file

@ -1,346 +0,0 @@
# syntax=docker/dockerfile:1.6
# escape=`
ARG OS_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
ARG NASM_VERSION=3.02
ARG VS_BUILDTOOLS_VERSION=17
ARG PWSH_VERSION=7.6.3
ARG PCRE2_VERSION=10.47
ARG OPENSSL_VERSION=4.0.1
ARG LIBMODBUS_VERSION=3.2.0
ARG ZLIB_VERSION=1.3.2
ARG CURL_VERSION=8.21.0
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
FROM ${OS_BASE_IMAGE} AS src
ARG NASM_VERSION
ARG VS_BUILDTOOLS_VERSION
ARG PWSH_VERSION
ARG PCRE2_VERSION
ARG OPENSSL_VERSION
ARG LIBMODBUS_VERSION
ARG ZLIB_VERSION
ARG CURL_VERSION
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.55.0.windows.2/MinGit-2.55.0.2-64-bit.zip
ARG PERL_URL=https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54221_64bit/strawberry-perl-5.42.2.1-64bit-portable.zip
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/$VS_BUILDTOOLS_VERSION/release/vs_buildtools.exe
ARG NASM_URL=https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/win64/nasm-$NASM_VERSION-win64.zip
ARG PCRE2_URL=https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.zip
ARG OPENSSL_URL=https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz
ARG LIBMODBUS_URL=https://github.com/stephane/libmodbus/archive/refs/tags/v$LIBMODBUS_VERSION.tar.gz
ARG ZLIB_URL=https://zlib.net/zlib-$ZLIB_VERSION.tar.gz
ARG CURL_URL=https://curl.se/download/curl-$CURL_VERSION.tar.gz
ARG PWSH_URL=https://github.com/PowerShell/PowerShell/releases/download/v$PWSH_VERSION/PowerShell-$PWSH_VERSION-win-x64.zip
ADD --checksum=sha256:d74c183c86c77248ad50017c7f45bae8f88106a6cca5d87ad09917e1c6fb0784 $PCRE2_URL build_src\pcre2.zip
ADD --checksum=sha256:2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09 $OPENSSL_URL build_src\openssl.tar.gz
ADD --checksum=sha256:72239f319b9b8483e3d393c5a60865d734fcff18a8abbb2486e389834a2f6ef1 $LIBMODBUS_URL build_src\libmodbus.tar.gz
ADD --checksum=sha256:bb329a0a2cd0274d05519d61c667c062e06990d72e125ee2dfa8de64f0119d16 $ZLIB_URL build_src\zlib.tar.gz
ADD --checksum=sha256:d9b327997999045a24cda50f3983e69e51c516bd8be6ef9842fc7f99135e33bb $CURL_URL build_src\curl.tar.gz
ADD --checksum=sha256:07ddb0d00b660459560ef82a9841da7705b27cd5dcca5a0d7b025a98eca29eca $PWSH_URL build_deps\pwsh.zip
ADD --checksum=sha256:e3ea2944cea4b3fabcd69c7c1669ef69b1b66c05ac7806d81224d0abad2dec31 $GIT_URL build_deps\git.zip
ADD --checksum=sha256:32d83be90cf04b807cfb9477482bc36302cdee6f5b04cf57e81adecbd8f07898 $PERL_URL build_deps\perl.zip
ADD --checksum=sha256:161d0bfaff53c2f9e9f3e69fd0672323ebabafd1268976a5cec11be92a19aee7 $NASM_URL build_deps\nasm.zip
ADD $VS_BUILDTOOLS_URL build_deps\vs_buildtools.exe
COPY CMakeLists.txt build_src\libmodbus_project\
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Set-Location -Path $env:SystemDrive\.; `
`
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
$env:BUILD_DEPS = [string]::Format('{0}\build_deps', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_DEPS', $env:BUILD_DEPS, [EnvironmentVariableTarget]::Machine); `
`
Set-Location -Path $env:BUILD_DEPS; `
Write-Host 'Installing PowerShell...'; `
Expand-Archive `
-Path $env:BUILD_DEPS\pwsh.zip `
-DestinationPath $env:BUILD_DEPS\pwsh\.; `
Get-ChildItem -Path $env:BUILD_DEPS\pwsh -Directory | Where-Object { `
$_.Name -match '^(cs|de|es|fr|it|ja|ko|pl|pt-BR|ru|tr|zh-Hans|zh-Hant)$' `
} | Remove-Item -Recurse -Force; `
Get-ChildItem -Path $env:BUILD_DEPS\pwsh -Recurse -Include '*.xml' | Where-Object { $_.FullName -notmatch '\\en-US\\' } | Remove-Item -Force; `
Get-ChildItem -Path $env:BUILD_DEPS\pwsh -Recurse -Include '*.resources.dll' | Where-Object { $_.FullName -notmatch '\\en-US\\' } | Remove-Item -Force; `
`
Write-Host 'Installing NASM...'; `
Expand-Archive `
-Path $env:BUILD_DEPS\nasm.zip `
-DestinationPath $env:BUILD_DEPS\.; `
Rename-Item -Path $env:BUILD_DEPS\nasm-$env:NASM_VERSION -NewName $env:BUILD_DEPS\NASM; `
`
Write-Host 'Installing GIT...'; `
Expand-Archive `
-Path $env:BUILD_DEPS\git.zip `
-DestinationPath $env:BUILD_DEPS\git\.; `
`
Write-Host 'Installing Perl...'; `
Expand-Archive -Path $env:BUILD_DEPS\perl.zip -DestinationPath $env:BUILD_DEPS\perl\; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\perl\c\; `
`
Set-Location -Path $env:BUILD_SRC; `
`
Write-Host 'Extracting PCRE2 archive ...'; `
Expand-Archive -Path $env:BUILD_SRC\pcre2.zip -DestinationPath $env:BUILD_SRC; `
Rename-Item -Path $env:BUILD_SRC\pcre2-$env:PCRE2_VERSION -NewName $env:BUILD_SRC\pcre2; `
New-Item -ItemType directory -Path "$env:BUILD_SRC\pcre2\build" | Out-Null; `
`
Write-Host 'Extracting OpenSSL archive ...'; `
tar -zxf $env:BUILD_SRC\openssl.tar.gz; `
Rename-Item -Path $env:BUILD_SRC\openssl-$env:OPENSSL_VERSION -NewName $env:BUILD_SRC\openssl; `
Remove-Item -Recurse -Force $env:BUILD_SRC\openssl\test -ErrorAction SilentlyContinue; `
`
Write-Host 'Extracting Libmodbus archive ...'; `
tar -zxf $env:BUILD_SRC\libmodbus.tar.gz; `
Move-Item -Path $env:BUILD_SRC\libmodbus-$env:LIBMODBUS_VERSION\ -Destination $env:BUILD_SRC\libmodbus; `
Copy-Item $env:BUILD_SRC\libmodbus_project\CMakeLists.txt -Destination $env:BUILD_SRC\libmodbus\CMakeLists.txt; `
Remove-Item -Force -Recurse $env:BUILD_SRC\libmodbus_project\; `
`
Write-Host 'Extracting Zlib archive ...'; `
tar -zxf $env:BUILD_SRC\zlib.tar.gz; `
Move-Item -Path $env:BUILD_SRC\zlib-$env:ZLIB_VERSION\ -Destination $env:BUILD_SRC\zlib; `
`
Write-Host 'Extracting CURL archive ...'; `
tar -zxf $env:BUILD_SRC\curl.tar.gz; `
Move-Item -Path $env:BUILD_SRC\curl-$env:CURL_VERSION\ -Destination $env:BUILD_SRC\curl; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Recurse $env:BUILD_SRC\*.tar.gz -ErrorAction SilentlyContinue; `
Remove-Item -Force -Recurse $env:BUILD_SRC\*.zip -ErrorAction SilentlyContinue; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.tar.gz -ErrorAction SilentlyContinue; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.zip -ErrorAction SilentlyContinue;
FROM ${OS_BASE_IMAGE}
ARG NASM_VERSION
ARG VS_BUILDTOOLS_VERSION
ARG PCRE2_VERSION
ARG OPENSSL_VERSION
ARG LIBMODBUS_VERSION
ARG ZLIB_VERSION
ARG CURL_VERSION
ARG MAJOR_VERSION
ARG ZBX_VERSION
ENV ZBX_VERSION=$ZBX_VERSION `
VS_BUILDTOOLS_VERSION=$VS_BUILDTOOLS_VERSION `
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION LIBMODBUS_VERSION=$LIBMODBUS_VERSION
LABEL org.opencontainers.image.title="Zabbix agent build base for Windows" `
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" `
org.opencontainers.image.vendor="Zabbix SIA" `
org.opencontainers.image.url="https://zabbix.com/" `
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix agent images" `
org.opencontainers.image.licenses="AGPL v3.0" `
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" `
org.opencontainers.image.version="${ZBX_VERSION}"
COPY --from=src build_src build_src
COPY --from=src build_deps build_deps
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Set-Location -Path $env:SystemDrive\.; `
`
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_OUTPUT', $env:BUILD_OUTPUT, [EnvironmentVariableTarget]::Machine); `
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
$env:BUILD_DEPS = [string]::Format('{0}\build_deps', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_DEPS', $env:BUILD_DEPS, [EnvironmentVariableTarget]::Machine); `
`
$env:PATH = [string]::Format('{0}\perl\perl\bin;{0}\NASM;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;', $env:BUILD_DEPS) + $env:PATH; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; `
Write-Host 'Verifying install ("git version") ...'; `
git version; `
`
Write-Host 'Verifying install ("nasm -v") ...'; `
nasm -v; `
`
Write-Host 'Verifying install ("perl -v") ...'; `
perl -v; `
`
Write-Host ('{0} - Visual Studio components installing...' -f $(Get-Date -format 'u')); `
cmd /C start /w $env:BUILD_DEPS\vs_buildtools.exe `
--quiet `
--wait `
--norestart `
--nocache `
--installPath """${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools""" `
--channelUri https://aka.ms/vs/$env:VS_BUILDTOOLS_VERSION/release/channel `
--installChannelUri https://aka.ms/vs/$env:VS_BUILDTOOLS_VERSION/release/channel `
--channelId VisualStudio.$env:VS_BUILDTOOLS_VERSION.Release `
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022
--add Microsoft.VisualStudio.Component.Windows11SDK.22621 `
--add Microsoft.VisualStudio.Component.VC.CMake.Project; `
if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { `
throw $err; `
}; `
Wait-Process -name msiexec; `
Write-Host ('{0} - Visual Studio components installed' -f $(Get-Date -format 'u')); `
`
$env:VS_PATH = &(Join-Path ${env:ProgramFiles(x86)} """\Microsoft Visual Studio\Installer\vswhere.exe""") -latest -products Microsoft.VisualStudio.Product.BuildTools -property installationPath; `
[Environment]::SetEnvironmentVariable('VS_PATH', $env:VS_PATH, [EnvironmentVariableTarget]::Machine); `
`
$env:VS_DEVSHELL = (Get-ChildItem $env:VS_PATH -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName; `
[Environment]::SetEnvironmentVariable('VS_DEVSHELL', $env:VS_DEVSHELL, [EnvironmentVariableTarget]::Machine); `
`
Write-Host 'Visual Studio components installation cleanup'; `
Get-ChildItem -Path """${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer""" -Directory -Recurse | Remove-Item -Force -Recurse; `
`
Write-Host 'Build environment is ready...';
RUN Import-Module $env:VS_DEVSHELL; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=x64"""; `
`
Write-Host 'Building Zlib library...'; `
Set-Location -Path $env:SystemDrive\.; `
$env:CL = """$env:CL /MP"""; `
cmake -S $env:BUILD_SRC\zlib -B $env:BUILD_SRC\zlib\build `
-G """Visual Studio 17 2022""" `
-A x64 `
-DZLIB_BUILD_TESTING=OFF `
-DZLIB_BUILD_SHARED=OFF `
-DZLIB_BUILD_STATIC=ON `
-DZLIB_BUILD_MINIZIP=OFF `
-DCMAKE_MSVC_RUNTIME_LIBRARY="""MultiThreaded$<$<CONFIG:Debug>:Debug>""" `
-DCMAKE_INSTALL_PREFIX="""$env:BUILD_OUTPUT\zlib"""; `
cmake --build $env:BUILD_SRC\zlib\build --config Release --parallel; `
cmake --install $env:BUILD_SRC\zlib\build --config Release; `
Remove-Item -Path $env:BUILD_SRC\zlib\build -Force -Recurse; `
Write-Host 'Zlib is ready...';
RUN Import-Module $env:VS_DEVSHELL; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=x64"""; `
`
Write-Host 'Building OpenSSL library...'; `
Set-Location -Path $env:BUILD_SRC\openssl; `
$env:CL = """$env:CL /nologo /MP /MT /wd4267 /wd4244"""; `
$env:NMAKEFLAGS = """/nologo"""; `
perl $env:BUILD_SRC\openssl\Configure `
VC-WIN64A `
no-autoload-config `
no-apps `
no-docs `
no-dgram `
no-dtls1-method `
no-dtls1_2-method `
no-gost `
no-shared `
no-srp `
no-module `
no-makedepend `
no-tests `
no-ui-console `
no-winstore `
--api=1.1.0 `
no-deprecated `
--prefix=$env:BUILD_OUTPUT\openssl `
--openssldir=$env:BUILD_OUTPUT\openssl_ssl; `
nmake /S build_libs | Out-Null; `
nmake /S INSTALLDOCS=0 INSTALLHTML=0 install_dev; `
$ErrorActionPreference = 'Continue'; `
nmake /S clean 2>$null | Out-Null; `
Write-Host 'OpenSSL is ready...';
RUN Import-Module $env:VS_DEVSHELL; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=x64"""; `
`
Write-Host 'Building PCRE2 library ...'; `
Set-Location -Path $env:BUILD_SRC\pcre2; `
$env:CL = """$env:CL /MP"""; `
cmake -S $env:BUILD_SRC\pcre2 -B $env:BUILD_SRC\pcre2\build `
-G """Visual Studio 17 2022""" `
-A x64 `
-DBUILD_SHARED_LIBS=OFF `
-DBUILD_STATIC_LIBS=ON `
-DPCRE2_BUILD_PCRE2_8=ON `
-DPCRE2_BUILD_PCRE2_16=OFF `
-DPCRE2_BUILD_PCRE2_32=OFF `
-DPCRE2_BUILD_PCRE2GREP=OFF `
-DPCRE2_BUILD_TESTS=OFF `
-DPCRE2_DEBUG=OFF `
-DPCRE2_SUPPORT_JIT=OFF `
-DPCRE2_SUPPORT_UNICODE=ON `
-DINSTALL_MSVC_PDB=OFF `
-DCMAKE_MSVC_RUNTIME_LIBRARY="""MultiThreaded$<$<CONFIG:Debug>:Debug>""" `
-DCMAKE_INSTALL_PREFIX="""$env:BUILD_OUTPUT\pcre2"""; `
`
cmake --build $env:BUILD_SRC\pcre2\build --config Release --parallel; `
cmake --install $env:BUILD_SRC\pcre2\build --config Release; `
`
Remove-Item -Recurse -Force -Path $env:BUILD_OUTPUT\pcre2\share -ErrorAction SilentlyContinue; `
Remove-Item -Recurse -Force $env:BUILD_SRC\pcre2\build; `
Write-Host 'PCRE2 is ready...';
RUN Import-Module $env:VS_DEVSHELL; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=x64"""; `
`
Write-Host 'Building Libmodbus library ...'; `
$env:CL = """$env:CL /MP"""; `
Set-Location -Path $env:BUILD_SRC\libmodbus\src\win32; `
cscript //nologo .\configure.js; `
Set-Location -Path $env:BUILD_SRC\libmodbus; `
cmake -S $env:BUILD_SRC\libmodbus -B $env:BUILD_SRC\libmodbus\build `
-G """Visual Studio 17 2022""" `
-A x64 `
-DBUILD_SHARED_LIBS=OFF `
-DCMAKE_MSVC_RUNTIME_LIBRARY="""MultiThreaded$<$<CONFIG:Debug>:Debug>""" `
-DCMAKE_INSTALL_PREFIX="""$env:BUILD_OUTPUT\libmodbus"""; `
`
cmake --build $env:BUILD_SRC\libmodbus\build --config Release --parallel; `
cmake --install $env:BUILD_SRC\libmodbus\build --config Release; `
Remove-Item -Recurse -Force $env:BUILD_SRC\libmodbus\build; `
Write-Host 'Libmodbus is ready...';
RUN Import-Module $env:VS_DEVSHELL; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=x64"""; `
Write-Host 'Building Curl library...'; `
Set-Location -Path $env:BUILD_SRC\curl; `
$env:CL = """$env:CL /MP"""; `
cmake -S $env:BUILD_SRC\curl -B $env:BUILD_SRC\curl\build `
-G """Visual Studio 17 2022""" `
-A x64 `
-DCMAKE_MSVC_RUNTIME_LIBRARY="""MultiThreaded$<$<CONFIG:Debug>:Debug>""" `
-DBUILD_CURL_EXE=OFF `
-DBUILD_EXAMPLES=OFF `
-DBUILD_TESTING=OFF `
-DENABLE_CURL_MANUAL=OFF `
-DBUILD_LIBCURL_DOCS=OFF `
-DBUILD_MISC_DOCS=OFF `
-DBUILD_SHARED_LIBS=OFF `
-DBUILD_STATIC_LIBS=ON `
-DCURL_DISABLE_LDAP=ON `
-DCURL_DISABLE_LDAPS=ON `
-DCURL_STATIC_CRT=ON `
-DCURL_USE_LIBPSL=OFF `
-DCURL_USE_OPENSSL=ON `
-DCURL_ZLIB=ON `
-DENABLE_UNICODE=ON `
-DOPENSSL_ROOT_DIR="""$env:BUILD_OUTPUT\openssl""" `
-DOPENSSL_USE_STATIC_LIBS=ON `
-DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG=ON `
-DUSE_WIN32_IDN=OFF `
-DZLIB_INCLUDE_DIR="""$env:BUILD_OUTPUT\zlib\include""" `
-DZLIB_LIBRARY="""$env:BUILD_OUTPUT\zlib\lib\zs.lib""" `
-DZLIB_USE_STATIC_LIBS=ON `
-DCMAKE_INSTALL_PREFIX="""$env:BUILD_OUTPUT\curl"""; `
cmake --build $env:BUILD_SRC\curl\build --config Release --parallel; `
cmake --install $env:BUILD_SRC\curl\build --config Release; `
Remove-Item -Path $env:BUILD_SRC\curl\build\ -Force -Recurse;

View file

@ -1,219 +0,0 @@
# syntax=docker/dockerfile:1.6
# escape=`
ARG OS_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
ARG PCRE2_VERSION=10.47
ARG OPENSSL_VERSION=4.0.1
ARG GOLANG_VERSION=1.26.4
ARG PWSH_VERSION=7.6.3
ARG MSYSTEM=UCRT64
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
FROM ${OS_BASE_IMAGE} as src
ARG PCRE2_VERSION
ARG OPENSSL_VERSION
ARG GOLANG_VERSION
ARG PWSH_VERSION
ARG MSYSTEM
ARG MINGW_URL=https://github.com/niXman/mingw-builds-binaries/releases/download/16.1.0-rt_v14-rev1/x86_64-16.1.0-release-win32-seh-ucrt-rt_v14-rev1.7z
ARG GOLANG_URL=https://go.dev/dl/go$GOLANG_VERSION.windows-amd64.zip
ARG MSYS2_URL=https://github.com/msys2/msys2-installer/releases/download/2026-06-11/msys2-base-x86_64-20260611.sfx.exe
ARG PCRE2_URL=https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.zip
ARG OPENSSL_URL=https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz
ARG PWSH_URL=https://github.com/PowerShell/PowerShell/releases/download/v$PWSH_VERSION/PowerShell-$PWSH_VERSION-win-x64.zip
ADD --checksum=sha256:07ddb0d00b660459560ef82a9841da7705b27cd5dcca5a0d7b025a98eca29eca $PWSH_URL build_deps\pwsh.zip
ADD --checksum=sha256:3ca8fb4630b07c419cbdd51f754e31363cfcfb83b3a5354d9e895c90be2cc345 $GOLANG_URL build_deps\go_lang.zip
ADD --checksum=sha256:12d9b93100aa092831fa7931c57e58ec86946b1587907d20e2db81928c32a98a $MINGW_URL build_deps\mingw.7z
ADD --checksum=sha256:c105946e64e08f099ac0e4647461ce762b95333ad211777666476a9a41451d65 $MSYS2_URL build_deps\msys2.sfx.exe
ADD --checksum=sha256:d74c183c86c77248ad50017c7f45bae8f88106a6cca5d87ad09917e1c6fb0784 $PCRE2_URL build_src\pcre2.zip
ADD --checksum=sha256:2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09 $OPENSSL_URL build_src\openssl.tar.gz
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN $env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
$env:BUILD_DEPS = [string]::Format('{0}\build_deps', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_DEPS', $env:BUILD_DEPS, [EnvironmentVariableTarget]::Machine); `
$env:MSYS_BIN = [string]::Format('{0}\msys64\{1}\bin', $env:BUILD_DEPS, $env:MSYSTEM.ToLower()); `
[Environment]::SetEnvironmentVariable('MSYS_BIN', $env:MSYS_BIN, [EnvironmentVariableTarget]::Machine); `
`
$env:PATH = $env:PATH + [string]::Format(';{0}\mingw64\bin;{0}\go\bin;{0}\msys64\usr\bin', $env:BUILD_DEPS); `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
Set-Location -Path $env:BUILD_DEPS; `
Write-Host 'Installing PowerShell...'; `
Expand-Archive `
-Path $env:BUILD_DEPS\pwsh.zip `
-DestinationPath $env:BUILD_DEPS\pwsh\.; `
Get-ChildItem -Path $env:BUILD_DEPS\pwsh -Directory | Where-Object { `
$_.Name -match '^(cs|de|es|fr|it|ja|ko|pl|pt-BR|ru|tr|zh-Hans|zh-Hant)$' `
} | Remove-Item -Recurse -Force; `
Get-ChildItem -Path $env:BUILD_DEPS\pwsh -Recurse -Include '*.xml' | Where-Object { $_.FullName -notmatch '\\en-US\\' } | Remove-Item -Force; `
Get-ChildItem -Path $env:BUILD_DEPS\pwsh -Recurse -Include '*.resources.dll' | Where-Object { $_.FullName -notmatch '\\en-US\\' } | Remove-Item -Force; `
`
Write-Host 'Installing MSYS2...'; `
& $env:BUILD_DEPS\msys2.sfx.exe -y -o"""$env:BUILD_DEPS\""" | Out-Null; `
function msys() { bash @('-lc') + @Args; }; `
msys """sed -i -E '/^\[(clangarm64|mingw32|mingw64|clang64)\]/,/^Include/ s/^[^#]/#&/' /etc/pacman.conf"""; `
msys 'pacman --noprogressbar --noconfirm -Syuu'; `
msys 'pacman --noprogressbar --noconfirm -Syuu'; `
msys 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-7zip git'; `
msys 'pacman --noprogressbar --noconfirm -Scc'; `
msys 'rm -rf /usr/share/man/* /usr/share/doc/* /usr/share/locale/*'; `
msys 'rm -rf /$MSYSTEM/usr/share/man/* /$MSYSTEM/usr/share/doc/* /$MSYSTEM/usr/share/locale/*'; `
msys 'rm -rf /$MSYSTEM/share/man/* /$MSYSTEM/share/doc/* /$MSYSTEM/share/locale/*'; `
msys 'rm -rf /var/cache/pacman/pkg/*'; `
taskkill /F /FI 'MODULES eq msys-2.0.dll' | Out-Null; `
compact /c /i /s:$env:BUILD_DEPS\msys64 | Out-Null; `
`
Write-Host 'Installing Mingw-w64...'; `
& $env:MSYS_BIN\7z.exe x $env:BUILD_DEPS\mingw.7z -bso0 -bsp0; `
compact /c /i /s:$env:BUILD_DEPS\mingw64 | Out-Null; `
`
Write-Host 'Installing Go Lang...'; `
Expand-Archive -Path $env:BUILD_DEPS\go_lang.zip -DestinationPath $env:BUILD_DEPS; `
`
Set-Location -Path $env:BUILD_SRC; `
`
Write-Host 'Extracting PCRE2 archive ...'; `
Expand-Archive -Path $env:BUILD_SRC\pcre2.zip -DestinationPath $env:BUILD_SRC; `
Rename-Item -Path $env:BUILD_SRC\pcre2-$env:PCRE2_VERSION -NewName $env:BUILD_SRC\pcre2; `
`
Write-Host 'Extracting OpenSSL archive ...'; `
$env:SystemDirectory = [Environment]::SystemDirectory; `
tar -zxf "$env:BUILD_SRC\openssl.tar.gz"; `
Rename-Item -Path $env:BUILD_SRC\openssl-$env:OPENSSL_VERSION -NewName $env:BUILD_SRC\openssl; `
Remove-Item -Recurse -Force $env:BUILD_SRC\openssl\test -ErrorAction SilentlyContinue; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Recurse $env:BUILD_SRC\*.tar.gz -ErrorAction SilentlyContinue; `
Remove-Item -Force -Recurse $env:BUILD_SRC\*.zip -ErrorAction SilentlyContinue; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.tar.gz -ErrorAction SilentlyContinue; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.zip -ErrorAction SilentlyContinue; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.exe -ErrorAction SilentlyContinue; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.7z -ErrorAction SilentlyContinue;
FROM ${OS_BASE_IMAGE}
ARG PCRE2_VERSION
ARG OPENSSL_VERSION
ARG GOLANG_VERSION
ARG MSYSTEM
ARG MAJOR_VERSION
ARG ZBX_VERSION
ENV ZBX_VERSION=$ZBX_VERSION `
GOLANG_VERSION=$GOLANG_VERSION `
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
CHERE_INVOKING=yes MSYSTEM=$MSYSTEM
LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" `
org.opencontainers.image.vendor="Zabbix SIA" `
org.opencontainers.image.url="https://zabbix.com/" `
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix agent 2 images" `
org.opencontainers.image.licenses="AGPL v3.0" `
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" `
org.opencontainers.image.version="${ZBX_VERSION}"
COPY --from=src build_src build_src
COPY --from=src build_deps build_deps
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Set-Location -Path $env:SystemDrive\.; `
`
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_OUTPUT', $env:BUILD_OUTPUT, [EnvironmentVariableTarget]::Machine); `
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
$env:BUILD_DEPS = [string]::Format('{0}\build_deps', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_DEPS', $env:BUILD_DEPS, [EnvironmentVariableTarget]::Machine); `
$env:MSYS_BIN = [string]::Format('{0}\msys64\{1}\bin', $env:BUILD_DEPS, $env:MSYSTEM.ToLower()); `
[Environment]::SetEnvironmentVariable('MSYS_BIN', $env:MSYS_BIN, [EnvironmentVariableTarget]::Machine); `
`
$env:PATH = $env:PATH + [string]::Format(';{0}\mingw64\bin;{0}\go\bin;{0}\msys64\usr\bin', $env:BUILD_DEPS); `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; `
`
Write-Host 'Verifying install ("go version") ...'; `
go version; `
`
Write-Host 'Verifying install ("bash --version") ...'; `
bash --version; `
`
Write-Host 'Verifying install ("gcc -v") ...'; `
gcc -v; `
`
Write-Host 'Verifying install ("git -v") ...'; `
git --version; `
`
Write-Host 'Build environment is ready...';
RUN Write-Host 'Building PCRE2 library ...'; `
Set-Location -Path $env:BUILD_SRC\pcre2; `
& $env:MSYS_BIN\cmake.exe -S $env:BUILD_SRC\pcre2 -B $env:BUILD_SRC\pcre2\build `
-G 'MinGW Makefiles' `
-DBUILD_SHARED_LIBS=OFF `
-DBUILD_STATIC_LIBS=ON `
-DPCRE2_BUILD_PCRE2_8=ON `
-DPCRE2_BUILD_PCRE2_16=OFF `
-DPCRE2_BUILD_PCRE2_32=OFF `
-DPCRE2_BUILD_PCRE2GREP=OFF `
-DPCRE2_BUILD_TESTS=OFF `
-DPCRE2_DEBUG=OFF `
-DPCRE2_SUPPORT_JIT=OFF `
-DPCRE2_SUPPORT_UNICODE=ON `
-DCMAKE_C_COMPILER="""$env:BUILD_DEPS\mingw64\bin\gcc.exe""" `
-DCMAKE_C_FLAGS='-O2 -g' `
-DCMAKE_INSTALL_PREFIX="""$env:BUILD_OUTPUT\pcre2""" . ; `
Set-Location -Path $env:BUILD_SRC\pcre2\build; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS"""; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS""" install; `
mingw32-make -s clean | Out-Null; `
Remove-Item -Recurse -Force -Path $env:BUILD_OUTPUT\pcre2\share -ErrorAction SilentlyContinue; `
Write-Host 'PCRE2 is ready...';
RUN Write-Host 'Building OpenSSL library...'; `
Set-Location -Path $env:BUILD_SRC\openssl; `
$env:CFLAGS = """$env:CFLAGS -Wno-overflow""".Trim(); `
perl Configure `
mingw64 `
no-autoload-config `
no-apps `
no-docs `
no-dgram `
no-dtls1-method `
no-dtls1_2-method `
no-gost `
no-shared `
no-srp `
no-makedepend `
no-module `
no-tests `
no-ui-console `
no-winstore `
thread_scheme=winthreads `
--api=1.1.0 `
no-deprecated `
--libdir=lib `
--prefix=$env:BUILD_OUTPUT/openssl `
--openssldir=$env:BUILD_OUTPUT/openssl_ssl; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS""" build_libs; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS""" install_dev; `
mingw32-make -s clean | Out-Null; `
Write-Host 'OpenSSL is ready...'; `
Write-Host 'Build environment is ready';

View file

@ -1,187 +0,0 @@
# syntax=docker/dockerfile:1
# escape=`
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM $BUILD_BASE_IMAGE as builder_base
ARG PCRE2_VERSION=10.44
ARG OPENSSL_VERSION=3.3.2
ARG GOLANG_VERSION=1.23.2
ARG MSYSTEM=CLANG64
ARG BUILD_ARCH=x64
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.0
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
ARG GOLANG_URL=https://go.dev/dl/go$GOLANG_VERSION.windows-amd64.zip
ARG MSYS2_URL=https://api.github.com/repos/msys2/msys2-installer/releases/latest
ARG PCRE2_URL=https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.zip
ARG OPENSSL_URL=https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz
ENV ZBX_VERSION=$ZBX_VERSION `
BUILD_ARCH=$BUILD_ARCH `
GOLANG_VERSION=$GOLANG_VERSION MSYS2_URL=$MSYS2_URL `
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
CHERE_INVOKING=yes MSYSTEM=$MSYSTEM
LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" `
org.opencontainers.image.vendor="Zabbix SIA" `
org.opencontainers.image.url="https://zabbix.com/" `
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix agent 2 images" `
org.opencontainers.image.licenses="AGPL v3.0" `
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" `
org.opencontainers.image.version="${ZBX_VERSION}"
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ADD --checksum=sha256:21c6f0523abfd37a2f5cc85879d0ff32723ab496347f0d20793df888ecec3957 $PCRE2_URL C:\pcre2.zip
ADD --checksum=sha256:2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281 $OPENSSL_URL C:\openssl.tar.gz
RUN Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
$env:PATH = $env:PATH + [string]::Format(';{0}\go\bin;{0}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_OUTPUT', $env:BUILD_OUTPUT, [EnvironmentVariableTarget]::Machine); `
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
`
Write-Host ('Downloading {0} ...' -f $env:GOLANG_URL); `
Invoke-WebRequest -OutFile $env:TEMP\go_lang.zip -Uri $env:GOLANG_URL; `
`
$sha256 = 'bc28fe3002cd65cec65d0e4f6000584dacb8c71bfaff8801dfb532855ca42513'; `
$d_sha256 = (Get-FileHash $env:TEMP\go_lang.zip -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum Go Lang ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:VS_BUILDTOOLS_URL); `
Invoke-WebRequest -OutFile $env:TEMP\vs_buildtools.exe $env:VS_BUILDTOOLS_URL; `
`
Write-Host ('Downloading {0} ...' -f $env:MSYS2_URL); `
Invoke-WebRequest -OutFile $env:TEMP\msys2.sfx.exe -Uri $(Invoke-RestMethod -UseBasicParsing $env:MSYS2_URL | `
Select -ExpandProperty "assets" | `
Select -ExpandProperty "browser_download_url" | `
Select-String -Pattern '.sfx.exe$').ToString(); `
`
$sha256 = 'D96C53ECBFA4B9D81F6C58077965BB2E31472A8BDA4D4446EF8F45F9C601B11D'; `
$d_sha256 = (Get-FileHash $env:TEMP\msys2.sfx.exe -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ((Get-FileHash $env:TEMP\msys2.sfx.exe -Algorithm sha256).Hash -ne $sha256) { `
Write-Host ('Checksum MSYS2 ({0}) failed!' -f $d_sha256); `
# exit 1; `
}; `
`
Write-Host 'Installing Go Lang...'; `
Expand-Archive -Path $env:TEMP\go_lang.zip -DestinationPath $env:SystemDrive\; `
`
Write-Host 'Verifying install ("go version") ...'; `
go version; `
`
`
Write-Host 'Installing MSYS2...'; `
& $env:TEMP\msys2.sfx.exe -y -o"""$env:SystemDrive\""" | Out-Null; `
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-clang-x86_64-gcc-compat mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-make git'; `
bash -lc 'pacman --noprogressbar --noconfirm -Scc'; `
bash -lc 'rm -rf /usr/share/man/* /usr/share/doc/* /usr/share/locale/*'; `
bash -lc 'rm -rf /$MSYSTEM/usr/share/man/* /$MSYSTEM/usr/share/doc/* /$MSYSTEM/usr/share/locale/*'; `
bash -lc 'rm -rf /$MSYSTEM/share/man/* /$MSYSTEM/share/doc/* /$MSYSTEM/share/locale/*'; `
bash -lc 'rm -rf /var/cache/pacman/pkg/*'; `
taskkill /F /FI 'MODULES eq msys-2.0.dll' | Out-Null; `
compact /c /i /s:$env:SystemDrive\msys64 | Out-Null; `
`
Write-Host 'Verifying install ("bash --version") ...'; `
bash --version; `
`
Write-Host ('{0} - Visual Studio components installing...' -f $(Get-Date -format 'u')); `
cmd /C start /w $env:TEMP\vs_buildtools.exe `
--quiet `
--wait `
--norestart `
--nocache `
--installPath """${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools""" `
--channelUri https://aka.ms/vs/17/release/channel `
--installChannelUri https://aka.ms/vs/17/release/channel `
--channelId VisualStudio.17.Release `
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64; `
if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { `
throw $err; `
}; `
Wait-Process -name msiexec; `
Write-Host ('{0} - Visual Studio components installed' -f $(Get-Date -format 'u')); `
`
$env:VS_PATH = &(Join-Path ${env:ProgramFiles(x86)} """\Microsoft Visual Studio\Installer\vswhere.exe""") -latest -products Microsoft.VisualStudio.Product.BuildTools -property installationPath; `
[Environment]::SetEnvironmentVariable('VS_PATH', $env:VS_PATH, [EnvironmentVariableTarget]::Machine); `
`
Write-Host 'Visual Studio components installation cleanup'; `
Get-ChildItem -Path """${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer""" -Directory -Recurse | Remove-Item -Force -Recurse; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Recurse $env:TEMP\*; `
Write-Host 'Build environment is ready...'; `
`
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_SRC -Force | Out-Null; `
Set-Location -Path $env:BUILD_SRC; `
`
Write-Host 'Extracting PCRE2 archive ...'; `
Expand-Archive -Path $env:SystemDrive\pcre2.zip -DestinationPath $env:BUILD_SRC; `
Rename-Item -Path $env:BUILD_SRC\pcre2-$env:PCRE2_VERSION -NewName $env:BUILD_SRC\pcre2; `
`
Write-Host 'Extracting OpenSSL archive ...'; `
$env:SystemDirectory = [Environment]::SystemDirectory; `
tar -zxf "$env:SystemDrive\openssl.tar.gz"; `
Rename-Item -Path $env:BUILD_SRC\openssl-$env:OPENSSL_VERSION -NewName $env:BUILD_SRC\openssl; `
`
Write-Host 'Building PCRE2 library ...'; `
Set-Location -Path $env:BUILD_SRC\pcre2; `
cmake --log-level=ERROR `
-G 'MinGW Makefiles' `
-DBUILD_SHARED_LIBS=OFF `
-DBUILD_STATIC_LIBS=ON `
-DPCRE2_DEBUG=OFF `
-DPCRE2_BUILD_TESTS=OFF `
-DINSTALL_MSVC_PDB=OFF `
-DCMAKE_C_COMPILER=gcc `
-DCMAKE_C_FLAGS='-O2 -g' `
-DCMAKE_INSTALL_PREFIX="""$env:BUILD_OUTPUT\pcre2""" . ; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS"""; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS""" install; `
mingw32-make -s clean | Out-Null; `
Remove-Item -Path $env:BUILD_OUTPUT\pcre2\share -Force -Recurse; `
Write-Host 'PCRE2 is ready...'; `
`
Write-Host 'Building OpenSSL library...'; `
Set-Location -Path $env:BUILD_SRC\openssl; `
perl Configure `
mingw64 `
no-shared `
no-ui-console `
no-tests `
no-unit-test `
no-capieng `
--api=1.1.0 `
--libdir=lib `
--prefix=$env:BUILD_OUTPUT/openssl `
--openssldir=$env:BUILD_OUTPUT/openssl_ssl; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS""" build_sw; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS""" install_dev; `
mingw32-make -s clean | Out-Null; `
Write-Host 'OpenSSL is ready...'; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Recurse $env:TEMP\*;

View file

@ -1,205 +0,0 @@
# syntax=docker/dockerfile:1
# escape=`
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM $BUILD_BASE_IMAGE as builder_base
ARG PCRE2_VERSION=10.44
ARG OPENSSL_VERSION=3.3.2
ARG GOLANG_VERSION=1.23.2
ARG MSYSTEM=MINGW64
ARG BUILD_ARCH=x64
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.0
ARG MINGW_URL=https://github.com/niXman/mingw-builds-binaries/releases/download/14.2.0-rt_v12-rev0/x86_64-14.2.0-release-win32-seh-msvcrt-rt_v12-rev0.7z
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
ARG GOLANG_URL=https://go.dev/dl/go$GOLANG_VERSION.windows-amd64.zip
ARG MSYS2_URL=https://api.github.com/repos/msys2/msys2-installer/releases/latest
ARG PCRE2_URL=https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.zip
ARG OPENSSL_URL=https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz
ENV ZBX_VERSION=$ZBX_VERSION `
BUILD_ARCH=$BUILD_ARCH `
MINGW_URL=$MINGW_URL VS_BUILDTOOLS_URL=$VS_BUILDTOOLS_URL GOLANG_VERSION=$GOLANG_VERSION MSYS2_URL=$MSYS2_URL `
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
CHERE_INVOKING=yes MSYSTEM=$MSYSTEM
LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" `
org.opencontainers.image.vendor="Zabbix SIA" `
org.opencontainers.image.url="https://zabbix.com/" `
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix agent 2 images" `
org.opencontainers.image.licenses="AGPL v3.0" `
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" `
org.opencontainers.image.version="${ZBX_VERSION}"
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ADD --checksum=sha256:21c6f0523abfd37a2f5cc85879d0ff32723ab496347f0d20793df888ecec3957 $PCRE2_URL C:\pcre2.zip
ADD --checksum=sha256:2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281 $OPENSSL_URL C:\openssl.tar.gz
RUN Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
$env:PATH = $env:PATH + [string]::Format(';{0}\mingw64\bin;{0}\go\bin;{0}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_OUTPUT', $env:BUILD_OUTPUT, [EnvironmentVariableTarget]::Machine); `
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
`
Write-Host ('Downloading {0} ...' -f $env:GOLANG_URL); `
Invoke-WebRequest -OutFile $env:TEMP\go_lang.zip -Uri $env:GOLANG_URL; `
`
$sha256 = 'bc28fe3002cd65cec65d0e4f6000584dacb8c71bfaff8801dfb532855ca42513'; `
$d_sha256 = (Get-FileHash $env:TEMP\go_lang.zip -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum Go Lang ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:MSYS2_URL); `
Invoke-WebRequest -OutFile $env:TEMP\msys2.sfx.exe -Uri $(Invoke-RestMethod -UseBasicParsing $env:MSYS2_URL | `
Select -ExpandProperty "assets" | `
Select -ExpandProperty "browser_download_url" | `
Select-String -Pattern '.sfx.exe$').ToString(); `
`
$sha256 = 'D96C53ECBFA4B9D81F6C58077965BB2E31472A8BDA4D4446EF8F45F9C601B11D'; `
$d_sha256 = (Get-FileHash $env:TEMP\msys2.sfx.exe -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum MSYS2 ({0}) failed!' -f $d_sha256); `
# exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:MINGW_URL); `
Invoke-WebRequest -OutFile $env:TEMP\mingw.7z -Uri $env:MINGW_URL; `
`
$sha256 = '32bf3d1337c89f1f0326b42f49fea96fc7eb115af29b765a69bc69be546fd2a1'; `
$d_sha256 = (Get-FileHash $env:TEMP\mingw.7z -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum Mingw-w64 ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:VS_BUILDTOOLS_URL); `
Invoke-WebRequest -OutFile $env:TEMP\vs_buildtools.exe $env:VS_BUILDTOOLS_URL; `
`
Write-Host 'Installing Go Lang...'; `
Expand-Archive -Path $env:TEMP\go_lang.zip -DestinationPath $env:SystemDrive\; `
`
Write-Host 'Verifying install ("go version") ...'; `
go version; `
`
Write-Host 'Installing MSYS2...'; `
& $env:TEMP\msys2.sfx.exe -y -o"""$env:SystemDrive\""" | Out-Null; `
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-x86_64-cmake mingw-w64-x86_64-make mingw-w64-x86_64-7zip git'; `
bash -lc 'pacman --noprogressbar --noconfirm -Scc'; `
bash -lc 'rm -rf /usr/share/man/* /usr/share/doc/* /usr/share/locale/*'; `
bash -lc 'rm -rf /$MSYSTEM/usr/share/man/* /$MSYSTEM/usr/share/doc/* /$MSYSTEM/usr/share/locale/*'; `
bash -lc 'rm -rf /$MSYSTEM/share/man/* /$MSYSTEM/share/doc/* /$MSYSTEM/share/locale/*'; `
bash -lc 'rm -rf /var/cache/pacman/pkg/*'; `
taskkill /F /FI 'MODULES eq msys-2.0.dll' | Out-Null; `
compact /c /i /s:$env:SystemDrive\msys64 | Out-Null; `
`
Write-Host 'Verifying install ("bash --version") ...'; `
bash --version; `
`
Write-Host 'Installing Mingw-w64...'; `
7z x $env:TEMP\mingw.7z; `
compact /c /i /s:$env:SystemDrive\mingw64 | Out-Null; `
`
Write-Host 'Verifying install ("gcc -v") ...'; `
gcc -v; `
`
Write-Host ('{0} - Visual Studio components installing...' -f $(Get-Date -format 'u')); `
cmd /C start /w $env:TEMP\vs_buildtools.exe `
--quiet `
--wait `
--norestart `
--nocache `
--installPath """${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools""" `
--channelUri https://aka.ms/vs/17/release/channel `
--installChannelUri https://aka.ms/vs/17/release/channel `
--channelId VisualStudio.17.Release `
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64; `
if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { `
throw $err; `
}; `
Wait-Process -name msiexec; `
Write-Host ('{0} - Visual Studio components installed' -f $(Get-Date -format 'u')); `
`
$env:VS_PATH = &(Join-Path ${env:ProgramFiles(x86)} """\Microsoft Visual Studio\Installer\vswhere.exe""") -latest -products Microsoft.VisualStudio.Product.BuildTools -property installationPath; `
[Environment]::SetEnvironmentVariable('VS_PATH', $env:VS_PATH, [EnvironmentVariableTarget]::Machine); `
`
Write-Host 'Visual Studio components installation cleanup'; `
Get-ChildItem -Path """${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer""" -Directory -Recurse | Remove-Item -Force -Recurse; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Recurse $env:TEMP\*; `
Write-Host 'Build environment is ready...'; `
`
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_SRC -Force | Out-Null; `
Set-Location -Path $env:BUILD_SRC; `
`
Write-Host 'Extracting PCRE2 archive ...'; `
Expand-Archive -Path $env:SystemDrive\pcre2.zip -DestinationPath $env:BUILD_SRC; `
Rename-Item -Path $env:BUILD_SRC\pcre2-$env:PCRE2_VERSION -NewName $env:BUILD_SRC\pcre2; `
`
Write-Host 'Extracting OpenSSL archive ...'; `
$env:SystemDirectory = [Environment]::SystemDirectory; `
tar -zxf "$env:SystemDrive\openssl.tar.gz"; `
Rename-Item -Path $env:BUILD_SRC\openssl-$env:OPENSSL_VERSION -NewName $env:BUILD_SRC\openssl; `
`
Write-Host 'Building PCRE2 library ...'; `
Set-Location -Path $env:BUILD_SRC\pcre2; `
cmake --log-level=ERROR `
-G 'MinGW Makefiles' `
-DBUILD_SHARED_LIBS=OFF `
-DBUILD_STATIC_LIBS=ON `
-DPCRE2_DEBUG=OFF `
-DPCRE2_BUILD_TESTS=OFF `
-DINSTALL_MSVC_PDB=OFF `
-DCMAKE_C_COMPILER=gcc `
-DCMAKE_C_FLAGS='-O2 -g' `
-DCMAKE_INSTALL_PREFIX="""$env:BUILD_OUTPUT\pcre2""" . ; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS"""; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS""" install; `
mingw32-make -s clean | Out-Null; `
Remove-Item -Path $env:BUILD_OUTPUT\pcre2\share -Force -Recurse; `
Write-Host 'PCRE2 is ready...'; `
`
Write-Host 'Building OpenSSL library...'; `
Set-Location -Path $env:BUILD_SRC\openssl; `
perl Configure `
mingw64 `
no-shared `
no-ui-console `
no-tests `
no-unit-test `
no-capieng `
--api=1.1.0 `
--libdir=lib `
--prefix=$env:BUILD_OUTPUT/openssl `
--openssldir=$env:BUILD_OUTPUT/openssl_ssl; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS""" build_sw; `
mingw32-make -s -j"""$env:NUMBER_OF_PROCESSORS""" install_dev; `
mingw32-make -s clean | Out-Null; `
Write-Host 'OpenSSL is ready...'; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Recurse $env:TEMP\*;

View file

@ -1,140 +0,0 @@
# syntax=docker/dockerfile:1
# escape=`
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM $BUILD_BASE_IMAGE as builder_base
ARG GOLANG_VERSION=1.23.2
ARG BUILD_ARCH=x64
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.0
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/MinGit-2.47.1-busybox-64-bit.zip
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
ARG GOLANG_URL=https://go.dev/dl/go$GOLANG_VERSION.windows-amd64.zip
ARG LLVM_MINGW=https://github.com/mstorsjo/llvm-mingw/releases/download/20241030/llvm-mingw-20241030-ucrt-x86_64.zip
ARG VCPKG_GIT=https://github.com/microsoft/vcpkg.git
ENV ZBX_VERSION=$ZBX_VERSION `
BUILD_ARCH=$BUILD_ARCH `
GIT_URL=$GIT_URL `
GOLANG_VERSION=$GOLANG_VERSION LLVM_MINGW=$LLVM_MINGW VCPKG_GIT=$VCPKG_GIT `
VCPKG_BINARY_SOURCES=clear VCPKG_DEFAULT_TRIPLET=$BUILD_ARCH-mingw-static-release
LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" `
org.opencontainers.image.vendor="Zabbix SIA" `
org.opencontainers.image.url="https://zabbix.com/" `
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix agent 2 images" `
org.opencontainers.image.licenses="AGPL v3.0" `
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" `
org.opencontainers.image.version="${ZBX_VERSION}"
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
$env:PATH = [string]::Format('{0}\vcpkg;{0}\llvm_mingw\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_OUTPUT', $env:BUILD_OUTPUT, [EnvironmentVariableTarget]::Machine); `
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
`
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
`
$sha256 = '7b26cc61866c5c0ec050797f57837bf064eacd3aaa87ae316e96c6936235cf29'; `
$d_sha256 = (Get-FileHash $env:TEMP\git.zip -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum GIT for Windows ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:GOLANG_URL); `
Invoke-WebRequest -OutFile $env:TEMP\go_lang.zip -Uri $env:GOLANG_URL; `
`
$sha256 = 'bc28fe3002cd65cec65d0e4f6000584dacb8c71bfaff8801dfb532855ca42513'; `
$d_sha256 = (Get-FileHash $env:TEMP\go_lang.zip -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum Go Lang ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:LLVM_MINGW); `
Invoke-WebRequest -OutFile $env:TEMP\llvm_mingw.zip -Uri $env:LLVM_MINGW; `
`
$sha256 = '7dd9884c976bb20bcbcda9077aa3dd2e857cfd073012f39668cdeddb285d93f8'; `
$d_sha256 = (Get-FileHash $env:TEMP\llvm_mingw.zip -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ((Get-FileHash $env:TEMP\llvm_mingw.zip -Algorithm sha256).Hash -ne $sha256) { `
Write-Host ('Checksum LLVM MinGW ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:VS_BUILDTOOLS_URL); `
Invoke-WebRequest -OutFile $env:TEMP\vs_buildtools.exe $env:VS_BUILDTOOLS_URL; `
`
Write-Host 'Installing GIT...'; `
Expand-Archive `
-Path $env:TEMP\git.zip `
-DestinationPath $env:SystemDrive\git\.; `
Write-Host 'Removing downloaded...'; `
`
Write-Host 'Verifying install ("git version") ...'; `
git version; `
`
Write-Host 'Installing Go Lang...'; `
Expand-Archive -Path $env:TEMP\go_lang.zip -DestinationPath $env:SystemDrive\; `
Write-Host 'Verifying install ("go version") ...'; `
go version; `
`
Write-Host 'Installing LLVM MinGW ...'; `
Expand-Archive -Path $env:TEMP\llvm_mingw.zip -DestinationPath $env:SystemDrive\; `
Move-Item -Path $env:SystemDrive\llvm-mingw-20241030-ucrt-x86_64\ -Destination $env:SystemDrive\llvm_mingw; `
`
Write-Host 'Verifying install ("gcc -v") ...'; `
gcc -v; `
`
Write-Host ('{0} - Visual Studio components installing...' -f $(Get-Date -format 'u')); `
cmd /C start /w $env:TEMP\vs_buildtools.exe `
--quiet `
--wait `
--norestart `
--nocache `
--installPath """${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools""" `
--channelUri https://aka.ms/vs/17/release/channel `
--installChannelUri https://aka.ms/vs/17/release/channel `
--channelId VisualStudio.17.Release `
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64; `
if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { `
throw $err; `
}; `
Wait-Process -name msiexec; `
Write-Host ('{0} - Visual Studio components installed' -f $(Get-Date -format 'u')); `
`
$env:VS_PATH = &(Join-Path ${env:ProgramFiles(x86)} """\Microsoft Visual Studio\Installer\vswhere.exe""") -latest -products Microsoft.VisualStudio.Product.BuildTools -property installationPath; `
[Environment]::SetEnvironmentVariable('VS_PATH', $env:VS_PATH, [EnvironmentVariableTarget]::Machine); `
`
Write-Host 'Visual Studio components installation cleanup'; `
Get-ChildItem -Path """${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer""" -Directory -Recurse | Remove-Item -Force -Recurse; `
`
Write-Host 'Installing Vcpkg ...'; `
$env:VCPKG_DEFAULT_BINARY_CACHE = $env:TEMP; `
git clone $env:VCPKG_GIT $env:SystemDrive\vcpkg; `
& $env:SystemDrive\vcpkg\bootstrap-vcpkg.bat -disableMetrics; `
Copy-Item $env:SystemDrive\vcpkg\triplets\community\$env:BUILD_ARCH-mingw-static.cmake -Destination $env:SystemDrive\vcpkg\triplets\community\$env:VCPKG_DEFAULT_TRIPLET.cmake; `
Add-Content -Path $env:SystemDrive\vcpkg\triplets\community\$env:VCPKG_DEFAULT_TRIPLET.cmake -Value """set(VCPKG_BUILD_TYPE release)"""; `
Write-Host 'Installing dependencies ...'; `
vcpkg install libiconv pcre2 openssl; `
`
Write-Host 'Removing downloaded ...'; `
Remove-Item -Force -Recurse $env:TEMP\*; `
Write-Host 'Build environment is ready...';

View file

@ -1 +0,0 @@
../README.md

View file

@ -1,82 +0,0 @@
![logo](https://assets.zabbix.com/img/logo/zabbix_logo_500x131.png)
# What is Zabbix?
Zabbix is an enterprise-class open source distributed monitoring solution.
Zabbix is software that monitors numerous parameters of a network and the health and integrity of servers. Zabbix uses a flexible notification mechanism that allows users to configure e-mail based alerts for virtually any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning.
For more information and related downloads for Zabbix components, please visit https://hub.docker.com/u/zabbix/ and https://zabbix.com
# What is Zabbix build base (MySQL)?
Zabbix build base (MySQL) image is used for building Zabbix components. It contains compiled Zabbix components.
# Zabbix build base (MySQL) images
These are the only official Zabbix build base (MySQL) Docker images. They are based on Alpine Linux v3.24, Ubuntu 26.04 (resolute), CentOS Stream 10 and Oracle Linux 10 images. The available versions of the image are:
Zabbix build base 6.0 (tags: alpine-6.0-latest, ubuntu-6.0-latest, ol-6.0-latest)
Zabbix build base 6.0.* (tags: alpine-6.0.*, ubuntu-6.0.*, ol-6.0.*)
Zabbix build base 7.0 (tags: alpine-7.0-latest, ubuntu-7.0-latest, ol-7.0-latest)
Zabbix build base 7.0.* (tags: alpine-7.0.*, ubuntu-7.0.*, ol-7.0.*)
Zabbix build base 7.2 (tags: alpine-7.2-latest, ubuntu-7.2-latest, ol-7.2-latest)
Zabbix build base 7.2.* (tags: alpine-7.2.*, ubuntu-7.2.*, ol-7.2.*)
Zabbix build base 7.4 (tags: alpine-7.4-latest, ubuntu-7.4-latest, ol-7.4-latest, alpine-latest, ubuntu-latest, ol-latest, latest)
Zabbix build base 7.4.* (tags: alpine-7.4.*, ubuntu-7.4.*, ol-7.4.*)
Zabbix build base 8.0 (tags: alpine-trunk, ubuntu-trunk, ol-trunk)
Images are updated when new releases are published. The image with ``latest`` tag is based on Alpine Linux.
# How to use this image
The image is used to build / compile Zabbix components. Components are prepared for usage in any other images.
The image uses [Zabbix build base](https://github.com/zabbix/zabbix-docker/tree/7.4/Dockerfiles/build-base) image with prepared build environment as base image and build / compile Zabbix components only.
# The image variants
The `zabbix-build-mysql` images come in many flavors, each designed for a specific use case.
## `zabbix-build-mysql:alpine-<version>`
This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use [musl libc](http://www.musl-libc.org) instead of [glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
## `zabbix-build-mysql:ubuntu-<version>`
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
## `zabbix-build-mysql:ol-<version>`
Oracle Linux is an open-source operating system available under the GNU General Public License (GPLv2). Suitable for general purpose or Oracle workloads, it benefits from rigorous testing of more than 128,000 hours per day with real-world workloads and includes unique innovations such as Ksplice for zero-downtime kernel patching, DTrace for real-time diagnostics, the powerful Btrfs file system, and more.
# User Feedback
## Documentation
Documentation for this image is stored in the [`build-mysql/` directory](https://github.com/zabbix/zabbix-docker/tree/7.4/Dockerfiles/build-mysql) of the [`zabbix/zabbix-docker` GitHub repo](https://github.com/zabbix/zabbix-docker/). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/zabbix/zabbix-docker/blob/7.4/README.md) before attempting a pull request.
## Issues
If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues).
### Known issues
## Contributing
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/zabbix/zabbix-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
## License
Starting from Zabbix version 7.0, all subsequent Zabbix versions will be released under the GNU Affero General Public License version 3 (AGPLv3).
You can modify the relevant version and propagate such modified version under the terms of the AGPLv3 as published by the Free Software Foundation.
For additional details, including answers to common questions about the AGPLv3, see the generic FAQ from the [Free Software Foundation](http://www.fsf.org/licenses/gpl-faq.html).
Zabbix is Open Source Software, however, if you use Zabbix in a commercial context we kindly ask you to support the development of Zabbix by purchasing some level of technical support.
All previous Zabbix software versions up to 6.4 are released under the GNU General Public License version 2 (GPLv2). The formal terms of the GPLv2 and AGPLv3 can be found at http://www.fsf.org/licenses/.

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,212 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-base:alpine-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
ARG BUILD_JOBS
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS
ARG LDFLAGS
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix build base (MySQL)" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
CFLAGS=${CFLAGS:-"-O2 -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -pipe"} \
LDFLAGS=${LDFLAGS:-"-pie -Wl,-z,relro,-z,now,-z,defs -Wl,--as-needed"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
NVIDIA_GPU_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/nvidia-gpu.git NVIDIA_GPU_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION}
RUN --mount=from=sources,target=/tmp/src,ro \
--mount=type=bind,source=patches/,target=/tmp/patches,ro \
set -eux && \
mkdir -p \
${ZBX_OUTPUT_DIR}/agent/sbin \
${ZBX_OUTPUT_DIR}/agent/conf \
${ZBX_OUTPUT_DIR}/agent2/sbin \
${ZBX_OUTPUT_DIR}/agent2/conf \
${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d \
${ZBX_OUTPUT_DIR}/proxy/sbin \
${ZBX_OUTPUT_DIR}/proxy/conf \
${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE} \
${ZBX_OUTPUT_DIR}/server/sbin \
${ZBX_OUTPUT_DIR}/server/conf \
${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE} \
${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin \
${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib \
${ZBX_OUTPUT_DIR}/java_gateway/conf \
${ZBX_OUTPUT_DIR}/web_service/sbin \
${ZBX_OUTPUT_DIR}/web_service/conf \
${ZBX_OUTPUT_DIR}/web/conf \
${ZBX_OUTPUT_DIR}/general/sbin \
${ZBX_OUTPUT_DIR}/general/bin \
${ZBX_OUTPUT_DIR}/general/conf && \
if [ -f /tmp/src/bootstrap.sh ]; then \
mkdir -p "${ZBX_SOURCES_DIR}" && \
cp -a /tmp/src/. "${ZBX_SOURCES_DIR}/"; \
else \
git -c advice.detachedHead=false clone \
"${ZBX_SOURCES}" \
--branch "${GIT_BRANCH:-$ZBX_VERSION}" \
--depth 1 \
--single-branch \
"${ZBX_SOURCES_DIR}"; \
fi && \
cd "${ZBX_SOURCES_DIR}" && \
for patch_filename in /tmp/patches/*.patch; do \
[ -f "$patch_filename" ] || continue; \
patch -p1 < "$patch_filename"; \
done && \
if git rev-parse --short HEAD >/dev/null 2>&1; then \
zabbix_revision="$(git rev-parse --short HEAD)"; \
else \
zabbix_revision="unknown"; \
fi && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
WORKDIR ${ZBX_SOURCES_DIR}
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
--mount=from=config_templates,target=/tmp/conf,ro \
set -eux && \
cd "${ZBX_SOURCES_DIR}" && \
./bootstrap.sh && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
--with-ares \
--with-ldap \
--with-libcurl \
--with-libmodbus \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
--with-net-snmp \
--with-openipmi \
--with-openssl \
--with-ssh \
--with-unixodbc \
--silent && \
jobs="${BUILD_JOBS:-$(nproc)}" && \
make -j"${jobs}" -s dbschema && \
make -j"${jobs}" -s && \
make -j"${jobs}" -s gettext && \
cat "database/${DB_TYPE}/schema.sql" > "database/${DB_TYPE}/create.sql" && \
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/create.sql.gz" && \
cat "database/${DB_TYPE}/images.sql" >> "database/${DB_TYPE}/create.sql" && \
cat "database/${DB_TYPE}/data.sql" >> "database/${DB_TYPE}/create.sql" && \
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz" && \
rm -f "database/${DB_TYPE}/create.sql" && \
strip src/zabbix_agent/zabbix_agentd && \
strip src/zabbix_server/zabbix_server && \
strip src/zabbix_proxy/zabbix_proxy && \
strip src/zabbix_get/zabbix_get && \
strip src/zabbix_sender/zabbix_sender && \
strip src/go/bin/zabbix_agent2 || true && \
strip src/go/bin/zabbix_web_service || true && \
mv src/zabbix_agent/zabbix_agentd "${ZBX_OUTPUT_DIR}/agent/sbin/" && \
cp conf/zabbix_agentd.conf "${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf.dist" && \
cp -a conf/zabbix_agentd/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
cp -a /tmp/conf/agent/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
mv src/go/bin/zabbix_agent2 "${ZBX_OUTPUT_DIR}/agent2/sbin/" && \
cp src/go/conf/zabbix_agent2.conf "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf.dist" && \
cp -a src/go/conf/zabbix_agent2.d/. "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/" && \
cp -a /tmp/conf/agent2/. "${ZBX_OUTPUT_DIR}/agent2/conf/" && \
mv src/zabbix_server/zabbix_server "${ZBX_OUTPUT_DIR}/server/sbin/" && \
cp conf/zabbix_server.conf "${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf.dist" && \
cp -a /tmp/conf/server/. "${ZBX_OUTPUT_DIR}/server/conf/" && \
mv src/zabbix_proxy/zabbix_proxy "${ZBX_OUTPUT_DIR}/proxy/sbin/" && \
cp conf/zabbix_proxy.conf "${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf.dist" && \
cp -a /tmp/conf/proxy/. "${ZBX_OUTPUT_DIR}/proxy/conf/" && \
cp -a src/zabbix_java/bin/. "${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin/" && \
cp -a src/zabbix_java/lib/*.jar "${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib/" && \
cp src/zabbix_java/lib/logback.xml "${ZBX_OUTPUT_DIR}/java_gateway/conf/logback.xml.dist" && \
cp src/zabbix_java/lib/logback-console.xml "${ZBX_OUTPUT_DIR}/java_gateway/conf/logback-console.xml.dist" && \
cp -a /tmp/conf/java-gateway/. "${ZBX_OUTPUT_DIR}/java_gateway/conf/" && \
mv src/go/bin/zabbix_web_service "${ZBX_OUTPUT_DIR}/web_service/sbin/" && \
cp src/go/conf/zabbix_web_service.conf "${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf.dist" && \
cp -a /tmp/conf/web_service/. "${ZBX_OUTPUT_DIR}/web_service/conf/" && \
mv src/zabbix_get/zabbix_get "${ZBX_OUTPUT_DIR}/general/bin/" && \
mv src/zabbix_sender/zabbix_sender "${ZBX_OUTPUT_DIR}/general/bin/" && \
cp -a /tmp/conf/web/. "${ZBX_OUTPUT_DIR}/web/conf/" && \
make -s distclean
RUN set -eux && \
cd "${ZBX_SOURCES_DIR}" && \
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf" \
-o ui/assets/fonts/NotoSansCJKjp-Regular.otf && \
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/LICENSE" \
-o ui/assets/fonts/OFL.txt && \
sed -i -r 's/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/' ui/include/defines.inc.php && \
sed -i -r 's/\.ttf/\.otf/' ui/include/graphs.inc.php && \
rm -f ui/assets/fonts/DejaVuSans.ttf && \
chmod o+r ui/assets/fonts/*
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
set -eux && \
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin" && \
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d" && \
build_plugin() { \
name="$1"; \
repo="$2"; \
version="$3"; \
binary="$4"; \
conf="$5"; \
outname="$6"; \
workdir="/tmp/${name}-plugin-${version}"; \
rm -rf "$workdir"; \
git -c advice.detachedHead=false clone "$repo" \
--branch "$version" \
--depth 1 \
--single-branch \
"$workdir"; \
cd "$workdir"; \
make; \
strip "$binary" || true; \
mv "$binary" "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/${outname}"; \
cp "$conf" "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/"; \
make clean; \
}; \
build_plugin mongodb "${MONGODB_PLUGIN_SOURCES}" "${MONGODB_PLUGIN_VERSION}" \
zabbix-agent2-plugin-mongodb mongodb.conf mongodb && \
build_plugin postgresql "${POSTGRESQL_PLUGIN_SOURCES}" "${POSTGRESQL_PLUGIN_VERSION}" \
zabbix-agent2-plugin-postgresql postgresql.conf postgresql && \
build_plugin mssql "${MSSQL_PLUGIN_SOURCES}" "${MSSQL_PLUGIN_VERSION}" \
zabbix-agent2-plugin-mssql mssql.conf mssql && \
build_plugin ember "${EMBER_PLUS_PLUGIN_SOURCES}" "${EMBER_PLUS_PLUGIN_VERSION}" \
zabbix-agent2-plugin-ember-plus ember.conf ember-plus && \
build_plugin nvidia-gpu "${NVIDIA_GPU_PLUGIN_SOURCES}" "${NVIDIA_GPU_PLUGIN_VERSION}" \
zabbix-agent2-plugin-nvidia-gpu nvidia.conf nvidia-gpu

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1,17 +0,0 @@
diff --git a/src/go/cmd/zabbix_web_service/pdf_report_creator.go b/src/go/cmd/zabbix_web_service/pdf_report_creator.go
index afab41204d1..f1a9b859f34 100644
--- a/src/go/cmd/zabbix_web_service/pdf_report_creator.go
+++ b/src/go/cmd/zabbix_web_service/pdf_report_creator.go
@@ -100,7 +100,11 @@ func (h *handler) report(w http.ResponseWriter, r *http.Request) {
return
}
- opts := chromedp.DefaultExecAllocatorOptions[:]
+ opts := append(chromedp.DefaultExecAllocatorOptions[:],
+ chromedp.DisableGPU,
+ chromedp.NoSandbox,
+ chromedp.Flag("disable-setuid-sandbox", true),
+ )
if options.IgnoreURLCertErrors == 1 {
opts = append(opts, chromedp.Flag("ignore-certificate-errors", "1"))

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,212 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-base:centos-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
ARG BUILD_JOBS
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS
ARG LDFLAGS
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix build base (MySQL)" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
CFLAGS=${CFLAGS:-"-O2 -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -pipe"} \
LDFLAGS=${LDFLAGS:-"-pie -Wl,-z,relro,-z,now,-z,defs -Wl,--as-needed"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
NVIDIA_GPU_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/nvidia-gpu.git NVIDIA_GPU_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION}
RUN --mount=from=sources,target=/tmp/src,ro \
--mount=type=bind,source=patches/,target=/tmp/patches,ro \
set -eux && \
mkdir -p \
${ZBX_OUTPUT_DIR}/agent/sbin \
${ZBX_OUTPUT_DIR}/agent/conf \
${ZBX_OUTPUT_DIR}/agent2/sbin \
${ZBX_OUTPUT_DIR}/agent2/conf \
${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d \
${ZBX_OUTPUT_DIR}/proxy/sbin \
${ZBX_OUTPUT_DIR}/proxy/conf \
${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE} \
${ZBX_OUTPUT_DIR}/server/sbin \
${ZBX_OUTPUT_DIR}/server/conf \
${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE} \
${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin \
${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib \
${ZBX_OUTPUT_DIR}/java_gateway/conf \
${ZBX_OUTPUT_DIR}/web_service/sbin \
${ZBX_OUTPUT_DIR}/web_service/conf \
${ZBX_OUTPUT_DIR}/web/conf \
${ZBX_OUTPUT_DIR}/general/sbin \
${ZBX_OUTPUT_DIR}/general/bin \
${ZBX_OUTPUT_DIR}/general/conf && \
if [ -f /tmp/src/bootstrap.sh ]; then \
mkdir -p "${ZBX_SOURCES_DIR}" && \
cp -a /tmp/src/. "${ZBX_SOURCES_DIR}/"; \
else \
git -c advice.detachedHead=false clone \
"${ZBX_SOURCES}" \
--branch "${GIT_BRANCH:-$ZBX_VERSION}" \
--depth 1 \
--single-branch \
"${ZBX_SOURCES_DIR}"; \
fi && \
cd "${ZBX_SOURCES_DIR}" && \
for patch_filename in /tmp/patches/*.patch; do \
[ -f "$patch_filename" ] || continue; \
patch -p1 < "$patch_filename"; \
done && \
if git rev-parse --short HEAD >/dev/null 2>&1; then \
zabbix_revision="$(git rev-parse --short HEAD)"; \
else \
zabbix_revision="unknown"; \
fi && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
WORKDIR ${ZBX_SOURCES_DIR}
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
--mount=from=config_templates,target=/tmp/conf,ro \
set -eux && \
cd "${ZBX_SOURCES_DIR}" && \
./bootstrap.sh && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
--with-ares \
--with-ldap \
--with-libcurl \
--with-libmodbus \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
--with-net-snmp \
--with-openipmi \
--with-openssl \
--with-ssh \
--with-unixodbc \
--silent && \
jobs="${BUILD_JOBS:-$(nproc)}" && \
make -j"${jobs}" -s dbschema && \
make -j"${jobs}" -s && \
make -j"${jobs}" -s gettext && \
cat "database/${DB_TYPE}/schema.sql" > "database/${DB_TYPE}/create.sql" && \
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/create.sql.gz" && \
cat "database/${DB_TYPE}/images.sql" >> "database/${DB_TYPE}/create.sql" && \
cat "database/${DB_TYPE}/data.sql" >> "database/${DB_TYPE}/create.sql" && \
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz" && \
rm -f "database/${DB_TYPE}/create.sql" && \
strip src/zabbix_agent/zabbix_agentd && \
strip src/zabbix_server/zabbix_server && \
strip src/zabbix_proxy/zabbix_proxy && \
strip src/zabbix_get/zabbix_get && \
strip src/zabbix_sender/zabbix_sender && \
strip src/go/bin/zabbix_agent2 || true && \
strip src/go/bin/zabbix_web_service || true && \
mv src/zabbix_agent/zabbix_agentd "${ZBX_OUTPUT_DIR}/agent/sbin/" && \
cp conf/zabbix_agentd.conf "${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf.dist" && \
cp -a conf/zabbix_agentd/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
cp -a /tmp/conf/agent/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
mv src/go/bin/zabbix_agent2 "${ZBX_OUTPUT_DIR}/agent2/sbin/" && \
cp src/go/conf/zabbix_agent2.conf "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf.dist" && \
cp -a src/go/conf/zabbix_agent2.d/. "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/" && \
cp -a /tmp/conf/agent2/. "${ZBX_OUTPUT_DIR}/agent2/conf/" && \
mv src/zabbix_server/zabbix_server "${ZBX_OUTPUT_DIR}/server/sbin/" && \
cp conf/zabbix_server.conf "${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf.dist" && \
cp -a /tmp/conf/server/. "${ZBX_OUTPUT_DIR}/server/conf/" && \
mv src/zabbix_proxy/zabbix_proxy "${ZBX_OUTPUT_DIR}/proxy/sbin/" && \
cp conf/zabbix_proxy.conf "${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf.dist" && \
cp -a /tmp/conf/proxy/. "${ZBX_OUTPUT_DIR}/proxy/conf/" && \
cp -a src/zabbix_java/bin/. "${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin/" && \
cp -a src/zabbix_java/lib/*.jar "${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib/" && \
cp src/zabbix_java/lib/logback.xml "${ZBX_OUTPUT_DIR}/java_gateway/conf/logback.xml.dist" && \
cp src/zabbix_java/lib/logback-console.xml "${ZBX_OUTPUT_DIR}/java_gateway/conf/logback-console.xml.dist" && \
cp -a /tmp/conf/java-gateway/. "${ZBX_OUTPUT_DIR}/java_gateway/conf/" && \
mv src/go/bin/zabbix_web_service "${ZBX_OUTPUT_DIR}/web_service/sbin/" && \
cp src/go/conf/zabbix_web_service.conf "${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf.dist" && \
cp -a /tmp/conf/web_service/. "${ZBX_OUTPUT_DIR}/web_service/conf/" && \
mv src/zabbix_get/zabbix_get "${ZBX_OUTPUT_DIR}/general/bin/" && \
mv src/zabbix_sender/zabbix_sender "${ZBX_OUTPUT_DIR}/general/bin/" && \
cp -a /tmp/conf/web/. "${ZBX_OUTPUT_DIR}/web/conf/" && \
make -s distclean
RUN set -eux && \
cd "${ZBX_SOURCES_DIR}" && \
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf" \
-o ui/assets/fonts/NotoSansCJKjp-Regular.otf && \
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/LICENSE" \
-o ui/assets/fonts/OFL.txt && \
sed -i -r 's/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/' ui/include/defines.inc.php && \
sed -i -r 's/\.ttf/\.otf/' ui/include/graphs.inc.php && \
rm -f ui/assets/fonts/DejaVuSans.ttf && \
chmod o+r ui/assets/fonts/*
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
set -eux && \
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin" && \
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d" && \
build_plugin() { \
name="$1"; \
repo="$2"; \
version="$3"; \
binary="$4"; \
conf="$5"; \
outname="$6"; \
workdir="/tmp/${name}-plugin-${version}"; \
rm -rf "$workdir"; \
git -c advice.detachedHead=false clone "$repo" \
--branch "$version" \
--depth 1 \
--single-branch \
"$workdir"; \
cd "$workdir"; \
make; \
strip "$binary" || true; \
mv "$binary" "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/${outname}"; \
cp "$conf" "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/"; \
make clean; \
}; \
build_plugin mongodb "${MONGODB_PLUGIN_SOURCES}" "${MONGODB_PLUGIN_VERSION}" \
zabbix-agent2-plugin-mongodb mongodb.conf mongodb && \
build_plugin postgresql "${POSTGRESQL_PLUGIN_SOURCES}" "${POSTGRESQL_PLUGIN_VERSION}" \
zabbix-agent2-plugin-postgresql postgresql.conf postgresql && \
build_plugin mssql "${MSSQL_PLUGIN_SOURCES}" "${MSSQL_PLUGIN_VERSION}" \
zabbix-agent2-plugin-mssql mssql.conf mssql && \
build_plugin ember "${EMBER_PLUS_PLUGIN_SOURCES}" "${EMBER_PLUS_PLUGIN_VERSION}" \
zabbix-agent2-plugin-ember-plus ember.conf ember-plus && \
build_plugin nvidia-gpu "${NVIDIA_GPU_PLUGIN_SOURCES}" "${NVIDIA_GPU_PLUGIN_VERSION}" \
zabbix-agent2-plugin-nvidia-gpu nvidia.conf nvidia-gpu

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1,17 +0,0 @@
diff --git a/src/go/cmd/zabbix_web_service/pdf_report_creator.go b/src/go/cmd/zabbix_web_service/pdf_report_creator.go
index afab41204d1..f1a9b859f34 100644
--- a/src/go/cmd/zabbix_web_service/pdf_report_creator.go
+++ b/src/go/cmd/zabbix_web_service/pdf_report_creator.go
@@ -100,7 +100,11 @@ func (h *handler) report(w http.ResponseWriter, r *http.Request) {
return
}
- opts := chromedp.DefaultExecAllocatorOptions[:]
+ opts := append(chromedp.DefaultExecAllocatorOptions[:],
+ chromedp.DisableGPU,
+ chromedp.NoSandbox,
+ chromedp.Flag("disable-setuid-sandbox", true),
+ )
if options.IgnoreURLCertErrors == 1 {
opts = append(opts, chromedp.Flag("ignore-certificate-errors", "1"))

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,212 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-base:ol-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
ARG BUILD_JOBS
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS
ARG LDFLAGS
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" \
org.opencontainers.image.licenses="AGPL v3.0" \
org.opencontainers.image.source="${ZBX_SOURCES}" \
org.opencontainers.image.title="Zabbix build base (MySQL)" \
org.opencontainers.image.url="https://zabbix.com/" \
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
CFLAGS=${CFLAGS:-"-O2 -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -pipe"} \
LDFLAGS=${LDFLAGS:-"-pie -Wl,-z,relro,-z,now,-z,defs -Wl,--as-needed"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
NVIDIA_GPU_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/nvidia-gpu.git NVIDIA_GPU_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION}
RUN --mount=from=sources,target=/tmp/src,ro \
--mount=type=bind,source=patches/,target=/tmp/patches,ro \
set -eux && \
mkdir -p \
${ZBX_OUTPUT_DIR}/agent/sbin \
${ZBX_OUTPUT_DIR}/agent/conf \
${ZBX_OUTPUT_DIR}/agent2/sbin \
${ZBX_OUTPUT_DIR}/agent2/conf \
${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d \
${ZBX_OUTPUT_DIR}/proxy/sbin \
${ZBX_OUTPUT_DIR}/proxy/conf \
${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE} \
${ZBX_OUTPUT_DIR}/server/sbin \
${ZBX_OUTPUT_DIR}/server/conf \
${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE} \
${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin \
${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib \
${ZBX_OUTPUT_DIR}/java_gateway/conf \
${ZBX_OUTPUT_DIR}/web_service/sbin \
${ZBX_OUTPUT_DIR}/web_service/conf \
${ZBX_OUTPUT_DIR}/web/conf \
${ZBX_OUTPUT_DIR}/general/sbin \
${ZBX_OUTPUT_DIR}/general/bin \
${ZBX_OUTPUT_DIR}/general/conf && \
if [ -f /tmp/src/bootstrap.sh ]; then \
mkdir -p "${ZBX_SOURCES_DIR}" && \
cp -a /tmp/src/. "${ZBX_SOURCES_DIR}/"; \
else \
git -c advice.detachedHead=false clone \
"${ZBX_SOURCES}" \
--branch "${GIT_BRANCH:-$ZBX_VERSION}" \
--depth 1 \
--single-branch \
"${ZBX_SOURCES_DIR}"; \
fi && \
cd "${ZBX_SOURCES_DIR}" && \
for patch_filename in /tmp/patches/*.patch; do \
[ -f "$patch_filename" ] || continue; \
patch -p1 < "$patch_filename"; \
done && \
if git rev-parse --short HEAD >/dev/null 2>&1; then \
zabbix_revision="$(git rev-parse --short HEAD)"; \
else \
zabbix_revision="unknown"; \
fi && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
WORKDIR ${ZBX_SOURCES_DIR}
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
--mount=from=config_templates,target=/tmp/conf,ro \
set -eux && \
cd "${ZBX_SOURCES_DIR}" && \
./bootstrap.sh && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
--with-ares \
--with-ldap \
--with-libcurl \
--with-libmodbus \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
--with-net-snmp \
--with-openipmi \
--with-openssl \
--with-ssh \
--with-unixodbc \
--silent && \
jobs="${BUILD_JOBS:-$(nproc)}" && \
make -j"${jobs}" -s dbschema && \
make -j"${jobs}" -s && \
make -j"${jobs}" -s gettext && \
cat "database/${DB_TYPE}/schema.sql" > "database/${DB_TYPE}/create.sql" && \
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/create.sql.gz" && \
cat "database/${DB_TYPE}/images.sql" >> "database/${DB_TYPE}/create.sql" && \
cat "database/${DB_TYPE}/data.sql" >> "database/${DB_TYPE}/create.sql" && \
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz" && \
rm -f "database/${DB_TYPE}/create.sql" && \
strip src/zabbix_agent/zabbix_agentd && \
strip src/zabbix_server/zabbix_server && \
strip src/zabbix_proxy/zabbix_proxy && \
strip src/zabbix_get/zabbix_get && \
strip src/zabbix_sender/zabbix_sender && \
strip src/go/bin/zabbix_agent2 || true && \
strip src/go/bin/zabbix_web_service || true && \
mv src/zabbix_agent/zabbix_agentd "${ZBX_OUTPUT_DIR}/agent/sbin/" && \
cp conf/zabbix_agentd.conf "${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf.dist" && \
cp -a conf/zabbix_agentd/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
cp -a /tmp/conf/agent/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
mv src/go/bin/zabbix_agent2 "${ZBX_OUTPUT_DIR}/agent2/sbin/" && \
cp src/go/conf/zabbix_agent2.conf "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf.dist" && \
cp -a src/go/conf/zabbix_agent2.d/. "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/" && \
cp -a /tmp/conf/agent2/. "${ZBX_OUTPUT_DIR}/agent2/conf/" && \
mv src/zabbix_server/zabbix_server "${ZBX_OUTPUT_DIR}/server/sbin/" && \
cp conf/zabbix_server.conf "${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf.dist" && \
cp -a /tmp/conf/server/. "${ZBX_OUTPUT_DIR}/server/conf/" && \
mv src/zabbix_proxy/zabbix_proxy "${ZBX_OUTPUT_DIR}/proxy/sbin/" && \
cp conf/zabbix_proxy.conf "${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf.dist" && \
cp -a /tmp/conf/proxy/. "${ZBX_OUTPUT_DIR}/proxy/conf/" && \
cp -a src/zabbix_java/bin/. "${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin/" && \
cp -a src/zabbix_java/lib/*.jar "${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib/" && \
cp src/zabbix_java/lib/logback.xml "${ZBX_OUTPUT_DIR}/java_gateway/conf/logback.xml.dist" && \
cp src/zabbix_java/lib/logback-console.xml "${ZBX_OUTPUT_DIR}/java_gateway/conf/logback-console.xml.dist" && \
cp -a /tmp/conf/java-gateway/. "${ZBX_OUTPUT_DIR}/java_gateway/conf/" && \
mv src/go/bin/zabbix_web_service "${ZBX_OUTPUT_DIR}/web_service/sbin/" && \
cp src/go/conf/zabbix_web_service.conf "${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf.dist" && \
cp -a /tmp/conf/web_service/. "${ZBX_OUTPUT_DIR}/web_service/conf/" && \
mv src/zabbix_get/zabbix_get "${ZBX_OUTPUT_DIR}/general/bin/" && \
mv src/zabbix_sender/zabbix_sender "${ZBX_OUTPUT_DIR}/general/bin/" && \
cp -a /tmp/conf/web/. "${ZBX_OUTPUT_DIR}/web/conf/" && \
make -s distclean
RUN set -eux && \
cd "${ZBX_SOURCES_DIR}" && \
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf" \
-o ui/assets/fonts/NotoSansCJKjp-Regular.otf && \
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/LICENSE" \
-o ui/assets/fonts/OFL.txt && \
sed -i -r 's/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/' ui/include/defines.inc.php && \
sed -i -r 's/\.ttf/\.otf/' ui/include/graphs.inc.php && \
rm -f ui/assets/fonts/DejaVuSans.ttf && \
chmod o+r ui/assets/fonts/*
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
set -eux && \
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin" && \
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d" && \
build_plugin() { \
name="$1"; \
repo="$2"; \
version="$3"; \
binary="$4"; \
conf="$5"; \
outname="$6"; \
workdir="/tmp/${name}-plugin-${version}"; \
rm -rf "$workdir"; \
git -c advice.detachedHead=false clone "$repo" \
--branch "$version" \
--depth 1 \
--single-branch \
"$workdir"; \
cd "$workdir"; \
make; \
strip "$binary" || true; \
mv "$binary" "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/${outname}"; \
cp "$conf" "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/"; \
make clean; \
}; \
build_plugin mongodb "${MONGODB_PLUGIN_SOURCES}" "${MONGODB_PLUGIN_VERSION}" \
zabbix-agent2-plugin-mongodb mongodb.conf mongodb && \
build_plugin postgresql "${POSTGRESQL_PLUGIN_SOURCES}" "${POSTGRESQL_PLUGIN_VERSION}" \
zabbix-agent2-plugin-postgresql postgresql.conf postgresql && \
build_plugin mssql "${MSSQL_PLUGIN_SOURCES}" "${MSSQL_PLUGIN_VERSION}" \
zabbix-agent2-plugin-mssql mssql.conf mssql && \
build_plugin ember "${EMBER_PLUS_PLUGIN_SOURCES}" "${EMBER_PLUS_PLUGIN_VERSION}" \
zabbix-agent2-plugin-ember-plus ember.conf ember-plus && \
build_plugin nvidia-gpu "${NVIDIA_GPU_PLUGIN_SOURCES}" "${NVIDIA_GPU_PLUGIN_VERSION}" \
zabbix-agent2-plugin-nvidia-gpu nvidia.conf nvidia-gpu

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

View file

@ -1,17 +0,0 @@
diff --git a/src/go/cmd/zabbix_web_service/pdf_report_creator.go b/src/go/cmd/zabbix_web_service/pdf_report_creator.go
index afab41204d1..f1a9b859f34 100644
--- a/src/go/cmd/zabbix_web_service/pdf_report_creator.go
+++ b/src/go/cmd/zabbix_web_service/pdf_report_creator.go
@@ -100,7 +100,11 @@ func (h *handler) report(w http.ResponseWriter, r *http.Request) {
return
}
- opts := chromedp.DefaultExecAllocatorOptions[:]
+ opts := append(chromedp.DefaultExecAllocatorOptions[:],
+ chromedp.DisableGPU,
+ chromedp.NoSandbox,
+ chromedp.Flag("disable-setuid-sandbox", true),
+ )
if options.IgnoreURLCertErrors == 1 {
opts = append(opts, chromedp.Flag("ignore-certificate-errors", "1"))

View file

@ -1 +0,0 @@
build.sh

View file

@ -1,222 +0,0 @@
# syntax=docker/dockerfile:1.6
ARG MAJOR_VERSION=7.4
ARG RELEASE=12
ARG ZBX_VERSION=${MAJOR_VERSION}.12
ARG BUILD_BASE_IMAGE=zabbix-build-base:rhel-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
ARG BUILD_JOBS
ARG MAJOR_VERSION
ARG RELEASE
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS
ARG LDFLAGS
LABEL description="Zabbix build base for MySQL based images" \
maintainer="alexey.pustovalov@zabbix.com" \
name="zabbix/zabbix-build-mysql-74" \
release="${RELEASE}" \
summary="Zabbix build base (MySQL)" \
url="https://www.zabbix.com/" \
vendor="Zabbix SIA" \
version="${MAJOR_VERSION}" \
io.k8s.description="Zabbix build base for MySQL based images" \
io.k8s.display-name="Zabbix build base (MySQL)" \
io.openshift.expose-services="" \
io.openshift.tags="zabbix,build,mysql" \
org.label-schema.description="Zabbix build base for MySQL based images" \
org.label-schema.license="AGPL v3.0" \
org.label-schema.name="zabbix-build-mysql-rhel" \
org.label-schema.url="https://zabbix.com/" \
org.label-schema.vcs-ref="${VCS_REF}" \
org.label-schema.vendor="Zabbix SIA"
ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
CFLAGS=${CFLAGS:-"-O2 -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -pipe"} \
LDFLAGS=${LDFLAGS:-"-pie -Wl,-z,relro,-z,now,-z,defs -Wl,--as-needed"} \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} \
NVIDIA_GPU_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/nvidia-gpu.git NVIDIA_GPU_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION}
RUN --mount=from=sources,target=/tmp/src,z \
--mount=type=bind,source=patches/,target=/tmp/patches,z \
set -eux && \
mkdir -p \
${ZBX_OUTPUT_DIR}/agent/sbin \
${ZBX_OUTPUT_DIR}/agent/conf \
${ZBX_OUTPUT_DIR}/agent2/sbin \
${ZBX_OUTPUT_DIR}/agent2/conf \
${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d \
${ZBX_OUTPUT_DIR}/proxy/sbin \
${ZBX_OUTPUT_DIR}/proxy/conf \
${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE} \
${ZBX_OUTPUT_DIR}/server/sbin \
${ZBX_OUTPUT_DIR}/server/conf \
${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE} \
${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin \
${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib \
${ZBX_OUTPUT_DIR}/java_gateway/conf \
${ZBX_OUTPUT_DIR}/web_service/sbin \
${ZBX_OUTPUT_DIR}/web_service/conf \
${ZBX_OUTPUT_DIR}/web/conf \
${ZBX_OUTPUT_DIR}/general/sbin \
${ZBX_OUTPUT_DIR}/general/bin \
${ZBX_OUTPUT_DIR}/general/conf && \
if [ -f /tmp/src/bootstrap.sh ]; then \
mkdir -p "${ZBX_SOURCES_DIR}" && \
cp -a /tmp/src/. "${ZBX_SOURCES_DIR}/"; \
else \
git -c advice.detachedHead=false clone \
"${ZBX_SOURCES}" \
--branch "${GIT_BRANCH:-$ZBX_VERSION}" \
--depth 1 \
--single-branch \
"${ZBX_SOURCES_DIR}"; \
fi && \
cd "${ZBX_SOURCES_DIR}" && \
for patch_filename in /tmp/patches/*.patch; do \
[ -f "$patch_filename" ] || continue; \
patch -p1 < "$patch_filename"; \
done && \
if git rev-parse --short HEAD >/dev/null 2>&1; then \
zabbix_revision="$(git rev-parse --short HEAD)"; \
else \
zabbix_revision="unknown"; \
fi && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" include/version.h && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/go/pkg/version/version.go && \
sed -i "s/{ZABBIX_REVISION}/$zabbix_revision/g" src/zabbix_java/src/com/zabbix/gateway/GeneralInformation.java
WORKDIR ${ZBX_SOURCES_DIR}
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
--mount=from=config_templates,target=/tmp/conf,z \
set -eux && \
cd "${ZBX_SOURCES_DIR}" && \
./bootstrap.sh && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
--with-ares \
--with-ldap \
--with-libcurl \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
--with-net-snmp \
--with-openipmi \
--with-openssl \
--with-ssh \
--with-unixodbc \
--silent && \
jobs="${BUILD_JOBS:-$(nproc)}" && \
make -j"${jobs}" -s dbschema && \
make -j"${jobs}" -s && \
make -j"${jobs}" -s gettext && \
cat "database/${DB_TYPE}/schema.sql" > "database/${DB_TYPE}/create.sql" && \
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/proxy/database/${DB_TYPE}/create.sql.gz" && \
cat "database/${DB_TYPE}/images.sql" >> "database/${DB_TYPE}/create.sql" && \
cat "database/${DB_TYPE}/data.sql" >> "database/${DB_TYPE}/create.sql" && \
gzip -c "database/${DB_TYPE}/create.sql" > "${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz" && \
rm -f "database/${DB_TYPE}/create.sql" && \
strip src/zabbix_agent/zabbix_agentd && \
strip src/zabbix_server/zabbix_server && \
strip src/zabbix_proxy/zabbix_proxy && \
strip src/zabbix_get/zabbix_get && \
strip src/zabbix_sender/zabbix_sender && \
strip src/go/bin/zabbix_agent2 || true && \
strip src/go/bin/zabbix_web_service || true && \
mv src/zabbix_agent/zabbix_agentd "${ZBX_OUTPUT_DIR}/agent/sbin/" && \
cp conf/zabbix_agentd.conf "${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf.dist" && \
cp -a conf/zabbix_agentd/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
cp -a /tmp/conf/agent/. "${ZBX_OUTPUT_DIR}/agent/conf/" && \
mv src/go/bin/zabbix_agent2 "${ZBX_OUTPUT_DIR}/agent2/sbin/" && \
cp src/go/conf/zabbix_agent2.conf "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf.dist" && \
cp -a src/go/conf/zabbix_agent2.d/. "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/" && \
cp -a /tmp/conf/agent2/. "${ZBX_OUTPUT_DIR}/agent2/conf/" && \
mv src/zabbix_server/zabbix_server "${ZBX_OUTPUT_DIR}/server/sbin/" && \
cp conf/zabbix_server.conf "${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf.dist" && \
cp -a /tmp/conf/server/. "${ZBX_OUTPUT_DIR}/server/conf/" && \
mv src/zabbix_proxy/zabbix_proxy "${ZBX_OUTPUT_DIR}/proxy/sbin/" && \
cp conf/zabbix_proxy.conf "${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf.dist" && \
cp -a /tmp/conf/proxy/. "${ZBX_OUTPUT_DIR}/proxy/conf/" && \
cp -a src/zabbix_java/bin/. "${ZBX_OUTPUT_DIR}/java_gateway/sbin/bin/" && \
cp -a src/zabbix_java/lib/*.jar "${ZBX_OUTPUT_DIR}/java_gateway/sbin/lib/" && \
cp src/zabbix_java/lib/logback.xml "${ZBX_OUTPUT_DIR}/java_gateway/conf/logback.xml.dist" && \
cp src/zabbix_java/lib/logback-console.xml "${ZBX_OUTPUT_DIR}/java_gateway/conf/logback-console.xml.dist" && \
cp -a /tmp/conf/java-gateway/. "${ZBX_OUTPUT_DIR}/java_gateway/conf/" && \
mv src/go/bin/zabbix_web_service "${ZBX_OUTPUT_DIR}/web_service/sbin/" && \
cp src/go/conf/zabbix_web_service.conf "${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf.dist" && \
cp -a /tmp/conf/web_service/. "${ZBX_OUTPUT_DIR}/web_service/conf/" && \
mv src/zabbix_get/zabbix_get "${ZBX_OUTPUT_DIR}/general/bin/" && \
mv src/zabbix_sender/zabbix_sender "${ZBX_OUTPUT_DIR}/general/bin/" && \
cp -a /tmp/conf/web/. "${ZBX_OUTPUT_DIR}/web/conf/" && \
make -s distclean
RUN set -eux && \
cd "${ZBX_SOURCES_DIR}" && \
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/OTF/Japanese/NotoSansCJKjp-Regular.otf" \
-o ui/assets/fonts/NotoSansCJKjp-Regular.otf && \
curl --retry 5 --retry-all-errors --retry-delay 2 --tlsv1.2 -sSf -L \
"https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/LICENSE" \
-o ui/assets/fonts/OFL.txt && \
sed -i -r 's/(define\(.*_FONT_NAME.*)DejaVuSans/\1NotoSansCJKjp-Regular/' ui/include/defines.inc.php && \
sed -i -r 's/\.ttf/\.otf/' ui/include/graphs.inc.php && \
rm -f ui/assets/fonts/DejaVuSans.ttf && \
chmod o+r ui/assets/fonts/*
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
set -eux && \
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin" && \
mkdir -p "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d" && \
build_plugin() { \
name="$1"; \
repo="$2"; \
version="$3"; \
binary="$4"; \
conf="$5"; \
outname="$6"; \
workdir="/tmp/${name}-plugin-${version}"; \
rm -rf "$workdir"; \
git -c advice.detachedHead=false clone "$repo" \
--branch "$version" \
--depth 1 \
--single-branch \
"$workdir"; \
cd "$workdir"; \
make; \
strip "$binary" || true; \
mv "$binary" "${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/${outname}"; \
cp "$conf" "${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/"; \
make clean; \
}; \
build_plugin mongodb "${MONGODB_PLUGIN_SOURCES}" "${MONGODB_PLUGIN_VERSION}" \
zabbix-agent2-plugin-mongodb mongodb.conf mongodb && \
build_plugin postgresql "${POSTGRESQL_PLUGIN_SOURCES}" "${POSTGRESQL_PLUGIN_VERSION}" \
zabbix-agent2-plugin-postgresql postgresql.conf postgresql && \
build_plugin mssql "${MSSQL_PLUGIN_SOURCES}" "${MSSQL_PLUGIN_VERSION}" \
zabbix-agent2-plugin-mssql mssql.conf mssql && \
build_plugin ember "${EMBER_PLUS_PLUGIN_SOURCES}" "${EMBER_PLUS_PLUGIN_VERSION}" \
zabbix-agent2-plugin-ember-plus ember.conf ember-plus && \
build_plugin nvidia-gpu "${NVIDIA_GPU_PLUGIN_SOURCES}" "${NVIDIA_GPU_PLUGIN_VERSION}" \
zabbix-agent2-plugin-nvidia-gpu nvidia.conf nvidia-gpu

View file

@ -1 +0,0 @@
../README.md

View file

@ -1 +0,0 @@
../../../build.sh

Some files were not shown because too many files have changed in this diff Show more