Compare commits

...

334 Commits
7.0.22 ... 7.4

Author SHA1 Message Date
Alexey Pustovalov
b651d0e546 Removed env variables for arch for Windows images 2025-12-25 17:34:40 +09:00
Alexey Pustovalov
78ce5093c7 Removed env variables for arch for Windows images 2025-12-25 17:25:40 +09:00
Alexey Pustovalov
20b7c3f566 Updated qemu for actions 2025-12-23 02:32:52 +09:00
Alexey Pustovalov
ea2a43e692 Fix for RHEL images certification procedure 2025-12-21 10:53:10 +09:00
Alexey Pustovalov
7f122c4fa1 Minor fixes for Windows container build system 2025-12-21 00:41:54 +09:00
Alexey Pustovalov
1cfc72ebad Added additional host to white list 2025-12-20 22:38:19 +09:00
Alexey Pustovalov
8820908b86 Fixed pcre2 compilation on Windows for agent2 2025-12-20 12:47:46 +09:00
Alexey Pustovalov
5823311888 Fixed agent compilation on Windows. Minor redesign for build images on Windows 2025-12-20 01:35:36 +00:00
Alexey Pustovalov
339cc8bdb0 Added additional host to white list 2025-12-19 03:14:15 +09:00
Continuous Integration
3a5abe4617 Zabbix v7.4.6 release 2025-12-18 09:45:48 +02:00
Alexey Pustovalov
7e1a96eb00 Updated dependencies and build environment dependencies for Windows agents 2025-12-18 16:39:27 +09:00
Alexey Pustovalov
44c1992be6 Updated dependencies and build environment dependencies for Windows agents 2025-12-18 16:39:19 +09:00
Alexey Pustovalov
d5e70bbc31
Merge pull request #1824 from zabbix/dependabot/github_actions/github/codeql-action-4.31.8
Bump github/codeql-action from 4.31.0 to 4.31.8
2025-12-17 13:06:31 +09:00
Alexey Pustovalov
863b1628bb
Merge pull request #1823 from zabbix/dependabot/github_actions/actions/cache-5.0.1
Bump actions/cache from 4.3.0 to 5.0.1
2025-12-17 13:06:18 +09:00
Alexey Pustovalov
186d29fc77
Merge pull request #1822 from zabbix/dependabot/github_actions/docker/setup-qemu-action-3.7.0
Bump docker/setup-qemu-action from 3.6.0 to 3.7.0
2025-12-17 13:05:56 +09:00
Alexey Pustovalov
8d75f9d356
Merge pull request #1821 from zabbix/dependabot/github_actions/actions/dependency-review-action-4.8.2
Bump actions/dependency-review-action from 4.8.1 to 4.8.2
2025-12-17 13:05:44 +09:00
dependabot[bot]
801a741d50
Bump actions/dependency-review-action from 4.8.1 to 4.8.2
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.8.1 to 4.8.2.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](40c09b7dc9...3c4e3dcb1a)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: 4.8.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-17 04:05:33 +00:00
Alexey Pustovalov
89cb6bdc66
Merge pull request #1820 from zabbix/dependabot/github_actions/actions/upload-artifact-6.0.0
Bump actions/upload-artifact from 4.6.1 to 6.0.0
2025-12-17 13:05:17 +09:00
Alexey Pustovalov
005be07c63
Merge pull request #1819 from zabbix/dependabot/github_actions/peter-evans/dockerhub-description-5.0.0
Bump peter-evans/dockerhub-description from 4.0.0 to 5.0.0
2025-12-17 13:04:52 +09:00
Alexey Pustovalov
eafb5340ff
Merge pull request #1818 from zabbix/dependabot/github_actions/actions/checkout-6.0.1
Bump actions/checkout from 5.0.0 to 6.0.1
2025-12-17 13:04:21 +09:00
Alexey Pustovalov
8d14b04c58
Merge pull request #1817 from zabbix/dependabot/github_actions/SonarSource/sonarqube-scan-action-7.0.0
Bump SonarSource/sonarqube-scan-action from 6.0.0 to 7.0.0
2025-12-17 13:03:53 +09:00
Alexey Pustovalov
4c52d38506
Merge pull request #1816 from zabbix/dependabot/github_actions/ossf/scorecard-action-2.4.3
Bump ossf/scorecard-action from 2.4.1 to 2.4.3
2025-12-17 13:03:41 +09:00
Alexey Pustovalov
a75b0c69d7
Merge pull request #1815 from zabbix/dependabot/github_actions/step-security/harden-runner-2.14.0
Bump step-security/harden-runner from 2.13.1 to 2.14.0
2025-12-17 13:03:21 +09:00
dependabot[bot]
1a584b5a23
Bump actions/checkout from 5.0.0 to 6.0.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 5.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](08c6903cd8...8e8c483db8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-16 01:32:47 +00:00
Alexey Pustovalov
50b027269f Updated allowed endpoints 2025-12-16 10:31:25 +09:00
dependabot[bot]
2d0e60d57f
Bump github/codeql-action from 4.31.0 to 4.31.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.0 to 4.31.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4e94bd11f7...1b168cd394)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 06:12:07 +00:00
dependabot[bot]
2989ded3c1
Bump actions/cache from 4.3.0 to 5.0.1
Bumps [actions/cache](https://github.com/actions/cache) from 4.3.0 to 5.0.1.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](0057852bfa...9255dc7a25)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 06:11:58 +00:00
dependabot[bot]
53886b1e56
Bump docker/setup-qemu-action from 3.6.0 to 3.7.0
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](29109295f8...c7c5346462)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-version: 3.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 06:11:44 +00:00
dependabot[bot]
ef94106497
Bump actions/upload-artifact from 4.6.1 to 6.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.1 to 6.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](4cec3d8aa0...b7c566a772)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 06:11:36 +00:00
dependabot[bot]
b3d5beabaa
Bump peter-evans/dockerhub-description from 4.0.0 to 5.0.0
Bumps [peter-evans/dockerhub-description](https://github.com/peter-evans/dockerhub-description) from 4.0.0 to 5.0.0.
- [Release notes](https://github.com/peter-evans/dockerhub-description/releases)
- [Commits](e98e4d1628...1b9a80c056)

---
updated-dependencies:
- dependency-name: peter-evans/dockerhub-description
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 06:11:31 +00:00
dependabot[bot]
750c9d982e
Bump SonarSource/sonarqube-scan-action from 6.0.0 to 7.0.0
Bumps [SonarSource/sonarqube-scan-action](https://github.com/sonarsource/sonarqube-scan-action) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/sonarsource/sonarqube-scan-action/releases)
- [Commits](https://github.com/sonarsource/sonarqube-scan-action/compare/v6.0.0...v7.0.0)

---
updated-dependencies:
- dependency-name: SonarSource/sonarqube-scan-action
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 06:11:14 +00:00
dependabot[bot]
e7d4568afb
Bump ossf/scorecard-action from 2.4.1 to 2.4.3
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.1 to 2.4.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](f49aabe0b5...4eaacf0543)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 06:11:11 +00:00
dependabot[bot]
a333b4c03a
Bump step-security/harden-runner from 2.13.1 to 2.14.0
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.13.1 to 2.14.0.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](f4a75cfd61...20cf305ff2)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 06:11:06 +00:00
Alexey Pustovalov
13dd4cf567 Updated allowed endpoints 2025-12-15 15:04:55 +09:00
Alexey Pustovalov
739f83c427
Merge pull request #1746 from zabbix/dependabot/github_actions/docker/metadata-action-5.8.0
Bump docker/metadata-action from 5.7.0 to 5.8.0
2025-12-15 14:00:58 +09:00
Alexey Pustovalov
6b11be7b10
Merge pull request #1753 from zabbix/dependabot/github_actions/actions/checkout-5.0.0
Bump actions/checkout from 4.1.7 to 5.0.0
2025-12-15 14:00:46 +09:00
Alexey Pustovalov
866aa4e53c
Merge pull request #1766 from zabbix/dependabot/github_actions/actions/attest-build-provenance-3
Bump actions/attest-build-provenance from 2 to 3
2025-12-15 14:00:32 +09:00
Alexey Pustovalov
1ab0f7910a
Merge pull request #1769 from zabbix/dependabot/github_actions/actions/setup-python-6.0.0
Bump actions/setup-python from 5.4.0 to 6.0.0
2025-12-15 14:00:21 +09:00
Alexey Pustovalov
70ebd63b52
Merge pull request #1773 from zabbix/dependabot/github_actions/step-security/harden-runner-2.13.1
Bump step-security/harden-runner from 2.11.0 to 2.13.1
2025-12-15 14:00:09 +09:00
Alexey Pustovalov
47c3305a6c
Merge pull request #1781 from zabbix/dependabot/github_actions/actions/cache-4.3.0
Bump actions/cache from 4.2.2 to 4.3.0
2025-12-15 13:59:57 +09:00
Alexey Pustovalov
dcf2cda1a1
Merge pull request #1788 from zabbix/dependabot/github_actions/docker/login-action-3.6.0
Bump docker/login-action from 3.2.0 to 3.6.0
2025-12-15 13:59:45 +09:00
Alexey Pustovalov
540346db0a
Merge pull request #1797 from zabbix/dependabot/github_actions/actions/dependency-review-action-4.8.1
Bump actions/dependency-review-action from 4.3.3 to 4.8.1
2025-12-15 13:59:22 +09:00
Alexey Pustovalov
f0af7685c7
Merge pull request #1798 from zabbix/dependabot/github_actions/sigstore/cosign-installer-4.0.0
Bump sigstore/cosign-installer from 3.9.2 to 4.0.0
2025-12-15 13:59:11 +09:00
Alexey Pustovalov
c2dee31637
Merge pull request #1802 from zabbix/dependabot/github_actions/github/codeql-action-4.31.0
Bump github/codeql-action from 3.28.10 to 4.31.0
2025-12-15 13:58:29 +09:00
Alexey Pustovalov
2043ea4f18
Merge pull request #1778 from petrkle/7.4
Enable cidr in WEB_REAL_IP_FROM
2025-12-05 17:48:02 +09:00
Alexey Pustovalov
5d90a063b8 Fixed MariaDB connector TLS / SSL error with Oracle MySQL 2025-12-05 15:37:59 +09:00
Alexey Pustovalov
9890c36327 Fixed custom patches search 2025-12-05 15:36:20 +09:00
Alexey Pustovalov
c826638d38 Removed CentOS 10 from scan for vulnerabilities 2025-12-04 13:33:15 +09:00
Alexey Pustovalov
9a7ba6dbbe Updated Alpine Linux to 3.23 2025-12-04 12:59:44 +09:00
Alexey Pustovalov
bb9c218771 Fixed web-service building on RHEL 2025-12-02 15:57:45 +09:00
Alexey Pustovalov
f76b8d285a Fixed RedHat images build process 2025-12-02 15:57:37 +09:00
Alexey Pustovalov
3551587082 Fixed custom snmptrapd configuration file 2025-11-25 13:26:54 +09:00
Alexey Pustovalov
ad100c80ee Fixed web-service startup error 2025-11-19 17:39:03 +09:00
Alexey Pustovalov
4e182dedf1 Updated RHEL to 10.1 2025-11-17 18:54:47 +09:00
Alexey Pustovalov
17d5ed8d33 Fixed custom snmptrapd configuration file 2025-11-11 17:01:29 +09:00
Continuous Integration
846cd21c3d Zabbix v7.4.5 release 2025-11-03 13:44:46 +02:00
Continuous Integration
15e9afc872 Zabbix v7.4.4 release 2025-10-29 13:50:41 +02:00
dependabot[bot]
407291fa27
Bump github/codeql-action from 3.28.10 to 4.31.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.10 to 4.31.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b56ba49b26...4e94bd11f7)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 06:26:17 +00:00
dependabot[bot]
69342d9c63
Bump sigstore/cosign-installer from 3.9.2 to 4.0.0
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.9.2 to 4.0.0.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](d58896d6a1...faadad0cce)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-17 06:08:47 +00:00
dependabot[bot]
b5cd390fec
Bump actions/dependency-review-action from 4.3.3 to 4.8.1
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.3.3 to 4.8.1.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](72eb03d02c...40c09b7dc9)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: 4.8.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-13 06:12:49 +00:00
Alexey Pustovalov
b9037d85d7 Use c-ares library as DNS resolver 2025-10-03 12:02:10 +09:00
Alexey Pustovalov
b318f3d27b Use c-ares library as DNS resolver 2025-10-03 12:01:36 +09:00
Continuous Integration
15922fd093 Zabbix v7.4.3 release 2025-10-01 01:18:31 +03:00
dependabot[bot]
f9d4a03f85
Bump docker/login-action from 3.2.0 to 3.6.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.2.0 to 3.6.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](0d4c9c5ea7...5e57cd1181)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 3.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-30 06:09:05 +00:00
Alexey Pustovalov
e46c0832e1
Merge pull request #1784 from zabbix/dependabot/github_actions/dot-github/workflows/SonarSource/sonarqube-scan-action-6.0.0
Bump SonarSource/sonarqube-scan-action from 5.3.1 to 6.0.0 in /.github/workflows
2025-09-29 10:24:37 +09:00
Alexey Pustovalov
caafd5c50c Double quotes around patch path 2025-09-29 10:24:02 +09:00
dependabot[bot]
5630d98490
Bump SonarSource/sonarqube-scan-action in /.github/workflows
Bumps [SonarSource/sonarqube-scan-action](https://github.com/sonarsource/sonarqube-scan-action) from 5.3.1 to 6.0.0.
- [Release notes](https://github.com/sonarsource/sonarqube-scan-action/releases)
- [Commits](https://github.com/sonarsource/sonarqube-scan-action/compare/v5.3.1...v6.0.0)

---
updated-dependencies:
- dependency-name: SonarSource/sonarqube-scan-action
  dependency-version: 6.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-26 13:20:24 +00:00
Alexey Pustovalov
f5eefca0da
Merge pull request #1782 from zabbix/dependabot/github_actions/dot-github/workflows/SonarSource/sonarqube-scan-action-5.3.1
Bump SonarSource/sonarqube-scan-action from 5.2.0 to 5.3.1 in /.github/workflows
2025-09-26 12:00:09 +09:00
dependabot[bot]
422e32f250
Bump SonarSource/sonarqube-scan-action in /.github/workflows
Bumps [SonarSource/sonarqube-scan-action](https://github.com/sonarsource/sonarqube-scan-action) from 5.2.0 to 5.3.1.
- [Release notes](https://github.com/sonarsource/sonarqube-scan-action/releases)
- [Commits](https://github.com/sonarsource/sonarqube-scan-action/compare/v5.2.0...v5.3.1)

---
updated-dependencies:
- dependency-name: SonarSource/sonarqube-scan-action
  dependency-version: 5.3.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-26 02:59:40 +00:00
dependabot[bot]
30b3b669fb
Bump actions/cache from 4.2.2 to 4.3.0
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.2 to 4.3.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](d4323d4df1...0057852bfa)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-25 06:09:59 +00:00
Petr
808c6da0e6
Enable cidr in WEB_REAL_IP_FROM 2025-09-18 22:29:39 +02:00
dependabot[bot]
724a95d843
Bump step-security/harden-runner from 2.11.0 to 2.13.1
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.11.0 to 2.13.1.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](4d991eb9b9...f4a75cfd61)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.13.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 06:10:19 +00:00
dependabot[bot]
e670510045
Bump actions/setup-python from 5.4.0 to 6.0.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.4.0 to 6.0.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](42375524e2...e797f83bcb)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 11:15:59 +00:00
dependabot[bot]
f8ab63edab
Bump actions/attest-build-provenance from 2 to 3
Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 2 to 3.
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](https://github.com/actions/attest-build-provenance/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/attest-build-provenance
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-29 06:09:31 +00:00
Continuous Integration
c82b6e59f9 Zabbix v7.4.2 release 2025-08-25 16:03:08 +03:00
Alexey Pustovalov
3d2a0dd9aa Fixed base image for Apache images with PostgreSQL support 2025-08-21 14:09:29 +09:00
Alexey Pustovalov
f04527e490 Updated Go to 1.25.0 2025-08-18 16:47:01 +09:00
dependabot[bot]
b8688e438c
Bump actions/checkout from 4.1.7 to 5.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](692973e3d9...08c6903cd8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 13:56:17 +00:00
Alexey Pustovalov
54b5482cb1 Removed static cosign version 2025-08-06 13:24:12 +09:00
Alexey Pustovalov
0940058fd6
Merge pull request #1731 from zabbix/dependabot/github_actions/sigstore/cosign-installer-3.9.2
Bump sigstore/cosign-installer from 3.8.1 to 3.9.2
2025-08-06 12:49:37 +09:00
dependabot[bot]
3ef7c9131c
Bump docker/metadata-action from 5.7.0 to 5.8.0
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.7.0 to 5.8.0.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](902fa8ec7d...c1e51972af)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-version: 5.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 09:13:33 +00:00
Alexey Pustovalov
f50ab224a5 Removed s390x and added ppc64le for Ubuntu 2025-07-31 17:59:37 +09:00
Continuous Integration
906ed94ad5 Zabbix v7.4.1 release 2025-07-30 12:47:01 +03:00
Alexey Pustovalov
bf92828c2c Updated OpenSSL build flags for Windows Zabbix agent and Zabbix agent 2 2025-07-29 12:40:42 +09:00
Alexey Pustovalov
b0a9e8ee00
Merge pull request #1732 from zabbix/fix/7_4_mysql_db_variable_export
fix: 7.4 MYSQL_DB variable export
2025-07-18 17:18:20 +09:00
Marks Sunins
d57938e075
feat: set php mysqli socket to user provided value 2025-07-18 08:09:26 +00:00
Marks Sunins
744c5eed89
feat: set php mysqli socket to user provided value 2025-07-18 08:09:14 +00:00
Marks Sunins
d857a30bb1
refactor: unify mysql_connect_args in web-frontend
- Refactored mysql_connect_args to be set under a single condition
2025-07-18 08:09:04 +00:00
Alexey Pustovalov
80ae6c771f Updated Sonacloud workflow 2025-07-18 15:45:11 +09:00
dependabot[bot]
33b0cee1db
Bump sigstore/cosign-installer from 3.8.1 to 3.9.2
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.8.1 to 3.9.2.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](d7d6bc7722...d58896d6a1)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-version: 3.9.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-18 06:32:33 +00:00
Marks Sunins
7ed23e456c refactor: unify mysql_connect_args condition logic
- Refactored mysql_connect_args to be set under a single condition
2025-07-18 15:25:40 +09:00
Alexey Pustovalov
6aec0d215d Updated supported versions and removed old versions documentation 2025-07-18 14:31:59 +09:00
Marks Sunins
cacd04bcb1 fix: test ENV existence before exporting to config
- test `DB_SERVER_SOCKET` before set `ZBX_DB_SOCKET`
- test `DB_SERVER_HOST` before set `ZBX_DB_HOST`
- test `DB_SERVER_PORT` before set `ZBX_DB_PORT`
- remove trailing spaces in `docker-entrypoint.sh` files
2025-07-18 13:13:14 +09:00
Alexey Pustovalov
fc09a76aff Fixed temporary filesystem required for Chrome 2025-07-17 19:58:52 +09:00
Alexey Pustovalov
70953564f1 Fixed PostgreSQL 17 on Ubuntu images 2025-07-17 10:58:04 +09:00
Alexey Pustovalov
51b5f1a0f8 Fixed PostgreSQL 17 on Ubuntu images 2025-07-17 00:10:33 +09:00
Alexey Pustovalov
136d09f45e Fixed PostgreSQL 17 on Ubuntu images 2025-07-16 11:17:32 +09:00
Alexey Pustovalov
79d60209cd Removed orphaned *.pyc files from Ubuntu images 2025-07-15 18:05:00 +09:00
Alexey Pustovalov
3bc102be60 Fixed PostgreSQL 17 on Ubuntu images 2025-07-15 15:34:59 +09:00
Alexey Pustovalov
609866c700 Fixed maintenance message for Web-interface 2025-07-14 19:16:22 +09:00
Alexey Pustovalov
e983d96d30 Fixed package names for CentOS based images + removed LTSC2025 2025-07-08 14:26:49 +09:00
Alexey Pustovalov
20d11ee6d6 Added correct resolving for source IP addresses in case of HTTP proxies 2025-07-05 11:49:09 +03:00
Alexey Pustovalov
d6f0ef5997 Updated Oracle Linux 9 to 10 2025-07-04 10:37:03 +03:00
Alexey Pustovalov
24eec860fd Revert CentOS and remove deprecated Windows ltsc 2019 2025-07-01 20:19:52 +03:00
Pustovalov Alexey
c5681e8a90 Removed CentOS from build pipeline 2025-07-01 17:15:11 +03:00
Alexey Pustovalov
9dfc28bf0d
Merge pull request #1717 from zabbix/feat/release-7-4-0
feat: release Zabbix 7.4.0
2025-07-01 11:20:39 +03:00
Alexey Pustovalov
ea607c9ddd Updated Sonarcloud default branch 2025-07-01 11:20:08 +03:00
Marks Sunins
8534e1b944
chore: set Zabbix version tags in Dockerfiles 2025-07-01 06:33:40 +00:00
Marks Sunins
a84e942ce1
chore: update 7.4 README version references 2025-07-01 06:19:27 +00:00
Marks Sunins
eff34d0b87
chore: update 7.4 k8s image tags 2025-07-01 06:17:53 +00:00
Marks Sunins
230669ac0a
chore: set 7.4 default env vars 2025-07-01 06:16:55 +00:00
Alexey Pustovalov
39b04c8215 Added encryption support between server and frontend 2025-06-26 17:08:19 +09:00
Alexey Pustovalov
dc7086ede0 Added volume for custom MIBs 2025-06-10 14:34:47 +09:00
Alexey Pustovalov
4376467951 Updated readme 2025-06-04 13:04:48 +09:00
Alexey Pustovalov
0b40e2f006 Optimized Windows build environment 2025-06-03 06:51:15 +00:00
Alexey Pustovalov
c9c390b30e Optimized Windows build environment 2025-06-03 06:48:41 +00:00
Alexey Pustovalov
3e20237bdc Updated Alpine image to 3.22 version 2025-06-02 18:18:19 +09:00
Alexey Pustovalov
d0323bf85d Updated Alpine image to 3.22 version 2025-06-01 01:16:15 +09:00
Alexey Pustovalov
4a023d0937 Merge pull request #1665 from zabbix/feat/1298/kerberos-authentication-for-web-monitoring
Kerberos authentication for web monitoring #1298
2025-05-30 16:50:36 +09:00
Alexey Pustovalov
5d12e86b76 Added missing ping utility to all Server, Proxy and Agent images 2025-05-30 16:47:30 +09:00
Alexey Pustovalov
6ae4e8adf5 Increased build time for images 2025-05-29 10:26:18 +09:00
root
98aa0453a7 Updated PHP to 8.4 version on Alpine 2025-05-28 13:30:03 +00:00
root
4fb46b2122 Added Dockerfile for NVIDIA GPU monitoring 2025-05-28 07:48:15 +00:00
Alexey Pustovalov
9a0f5773e3 Using plain Windows nanoserver image for agent and agent2 images 2025-05-26 11:29:59 +09:00
Alexey Pustovalov
0101fb79b4 Using Windows nanoserver image instead of old Powershell image 2025-05-25 13:08:22 +00:00
Alexey Pustovalov
136ba9a5ed Using Windows nanoserver image instead of old Powershell image 2025-05-25 12:05:02 +00:00
Alexey Pustovalov
150a7c7d27 Removed Windows 2025 LTSC. Need to reorganizae powershell images (final) 2025-05-24 13:10:10 +09:00
Alexey Pustovalov
fb585c71ac Added Windows 2025 LTSC 2025-05-22 13:48:25 +09:00
Alexey Pustovalov
a0d7e57993 Updated libraries for Windows 2025-05-22 13:46:19 +09:00
Alexey Pustovalov
f57b511186 Updated CentOS Stream to 10 version from 9 2025-05-21 17:47:18 +09:00
Alexey Pustovalov
5602f6b383 Updated CentOS Stream to 10 version from 9 2025-05-21 17:46:39 +09:00
Alexey Pustovalov
ceb54c94a4 Updated RHEL from 9 to 10 2025-05-16 04:16:19 +09:00
Alexey Pustovalov
212f9019ba Updated RHEL from 9 to 10 2025-05-16 01:08:31 +09:00
Alexey Pustovalov
200d49489d
Merge pull request #1690 from zabbix/fix/DEVOPS-46/empty-db-socket
fix: env ZBX_DB_SOCKET being set to an empty value
2025-05-08 17:43:47 +09:00
Marks Sunins
13301349ae
fix: env ZBX_DB_SOCKET being set to an empty value 2025-05-08 08:34:08 +00:00
Alexey Pustovalov
750cce1334 Fixed fping binary permissions in Alpine images 2025-03-28 13:41:56 +09:00
Alexey Pustovalov
a0bac3925d Fixed ZBX_SSO_SETTINGS parameter format example 2025-03-14 16:48:54 +09:00
Alexey Pustovalov
6a58b8d00f Updated default PostgreSQL and TimescaleDB versions to 17 and 2.18.1 (PostgreSQL 17) 2025-03-13 15:31:49 +09:00
Alexey Pustovalov
9f12cc6022 Fixed usage Vault DB credentials with server and proxy 2025-03-13 15:24:12 +09:00
Alexey Pustovalov
de36c79a2c Merge pull request #1626 from zabbix/dependabot/github_actions/actions/setup-python-5.4.0
Bump actions/setup-python from 5.0.0 to 5.4.0
2025-03-06 16:02:47 +09:00
Alexey Pustovalov
0b8f537d6d Merge pull request #1638 from zabbix/dependabot/github_actions/step-security/harden-runner-2.11.0
Bump step-security/harden-runner from 2.10.3 to 2.11.0
2025-03-06 16:00:08 +09:00
Alexey Pustovalov
75bf967279 Merge pull request #1641 from zabbix/dependabot/github_actions/sigstore/cosign-installer-3.8.1
Bump sigstore/cosign-installer from 3.6.0 to 3.8.1
2025-03-06 16:00:08 +09:00
Alexey Pustovalov
a5dfac866c Merge pull request #1644 from zabbix/dependabot/github_actions/actions/upload-artifact-4.6.1
Bump actions/upload-artifact from 4.6.0 to 4.6.1
2025-03-06 16:00:08 +09:00
Alexey Pustovalov
742882ee0b Merge pull request #1645 from zabbix/dependabot/github_actions/ossf/scorecard-action-2.4.1
Bump ossf/scorecard-action from 2.3.1 to 2.4.1
2025-03-06 16:00:08 +09:00
Alexey Pustovalov
c29a5dd8c7 Merge pull request #1646 from zabbix/dependabot/github_actions/github/codeql-action-3.28.10
Bump github/codeql-action from 3.28.1 to 3.28.10
2025-03-06 16:00:08 +09:00
Alexey Pustovalov
b192250023 Added missing directory volume for additional libraries for Zabbix Java Gateway 2025-03-06 15:58:26 +09:00
dependabot[bot]
fcd7fb44ce Bump docker/setup-qemu-action from 3.4.0 to 3.6.0
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3.4.0 to 3.6.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](4574d27a47...29109295f8)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 15:56:21 +09:00
dependabot[bot]
c75787321d Bump actions/cache from 4.2.0 to 4.2.2
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.0 to 4.2.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](1bd1e32a3b...d4323d4df1)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 15:54:47 +09:00
dependabot[bot]
9303c172c5 Bump docker/metadata-action from 5.5.1 to 5.7.0
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.5.1 to 5.7.0.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](8e5442c4ef...902fa8ec7d)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 15:54:47 +09:00
dependabot[bot]
1f0170cbd0 Bump docker/build-push-action from 6.12.0 to 6.15.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.12.0 to 6.15.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](67a2d409c0...471d1dc4e0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 15:54:45 +09:00
dependabot[bot]
495eda0bff Bump docker/setup-buildx-action from 3.9.0 to 3.10.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.9.0 to 3.10.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](f7ce87c1d6...b5ca514318)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 15:54:26 +09:00
Alexey Pustovalov
c8820abfe4 Removed arm64 platform for web-service on Oracle Linux 2025-03-05 16:45:12 +09:00
Alexey Pustovalov
cd6a1d92ad Added missing ZBX_STARTSNMPPOLLERS to documentation 2025-02-27 13:15:20 +09:00
Alexey Pustovalov
c61c8c91e5 Fixed images dependencies in PostgreSQL variant compose files 2025-02-26 16:28:18 +09:00
Alexey Pustovalov
1185c4f0a3 Commented missing mount. Cannot build images on Podman 5+ 2025-02-26 13:18:59 +09:00
Alexey Pustovalov
8e26e7250b Updated OpenSSL version to 3.4.1 2025-02-19 14:31:56 +09:00
Alexey Pustovalov
afdac43d7b Updated OpenSSL version to 3.4.1 2025-02-19 14:15:22 +09:00
Alexey Pustovalov
e678ca156f Revert "Updated CentOS 9 to CentOS 10 Stream"
This reverts commit f0feafafc1.
2025-02-18 15:32:19 +09:00
Alexey Pustovalov
f0feafafc1 Updated CentOS 9 to CentOS 10 Stream 2025-02-17 15:11:04 +09:00
Alexey Pustovalov
cb1e3a1240 Fixed clean up error message on Windows 2025-02-16 15:50:35 +09:00
Alexey Pustovalov
2bd88d7f55 Fixed missing prepare_zbx_config function for some Nginx images 2025-02-12 13:51:08 +09:00
Alexey Pustovalov
565c5e0ea7 Fixed compose file variable 2025-01-31 13:43:26 +09:00
Alexey Pustovalov
8000c6b5e3 Removed cache for base images 2025-01-26 16:19:55 +09:00
Alexey Pustovalov
75b7bd8108 Removed cache for base images 2025-01-26 16:17:40 +09:00
Alexey Pustovalov
d2b828e8e1 Removed cache for base images 2025-01-26 16:16:09 +09:00
Alexey Pustovalov
e14e23dbe5 Removed cache for base images 2025-01-26 15:31:33 +09:00
Alexey Pustovalov
5d918e5d59 Removed cache for base images 2025-01-25 16:38:29 +09:00
Alexey Pustovalov
5f1b6289cf Removed cache for base images 2025-01-25 13:21:18 +09:00
Alexey Pustovalov
3976b96c74 Removed cache for base images 2025-01-24 17:22:50 +09:00
Alexey Pustovalov
a3107c7031 Merge pull request #1605 from zabbix/dependabot/github_actions/step-security/harden-runner-2.10.3
Bump step-security/harden-runner from 2.9.1 to 2.10.3
2025-01-17 17:13:22 +09:00
Alexey Pustovalov
590deee1a8 Merge pull request #1609 from zabbix/dependabot/github_actions/github/codeql-action-3.28.1
Bump github/codeql-action from 3.26.1 to 3.28.1
2025-01-17 17:13:22 +09:00
Alexey Pustovalov
e4e72484a5 Merge pull request #1604 from zabbix/dependabot/github_actions/docker/setup-qemu-action-3.3.0
Bump docker/setup-qemu-action from 3.1.0 to 3.3.0
2025-01-17 17:13:22 +09:00
Alexey Pustovalov
aaa83a5873 Merge pull request #1613 from zabbix/dependabot/github_actions/docker/build-push-action-6.12.0
Bump docker/build-push-action from 6.7.0 to 6.12.0
2025-01-17 17:13:22 +09:00
Alexey Pustovalov
ca0d629f17 Merge pull request #1603 from zabbix/dependabot/github_actions/actions/upload-artifact-4.6.0
Bump actions/upload-artifact from 4.3.6 to 4.6.0
2025-01-17 17:13:22 +09:00
Alexey Pustovalov
dfe97fa079 Merge pull request #1583 from zabbix/dependabot/github_actions/actions/cache-4.2.0
Bump actions/cache from 4.0.0 to 4.2.0
2025-01-17 17:13:22 +09:00
Alexey Pustovalov
429f5e7568 Added container scan tool 2025-01-17 16:44:37 +09:00
Alexey Pustovalov
9f8aef76a8 Fixed internal variable on Windows containers 2025-01-17 14:00:53 +09:00
Alexey Pustovalov
a1bcd2aece Added OpenSSL package to server and sqlite3 images. Required to perform rehash of added CA certificates 2025-01-16 13:53:02 +09:00
Alexey Pustovalov
04c3ea7a10 Fixed Nginx configuration dir on Ubuntu 2025-01-16 10:56:49 +09:00
Alexey Pustovalov
69cdfa9ffd Fixed snmptrapd persistent directory 2025-01-15 13:05:48 +09:00
Alexey Pustovalov
980260d273 Fixed snmptrapd persistent directory 2025-01-15 13:02:02 +09:00
Alexey Pustovalov
4f08636f83 Fixed dependency for snmptraps container 2025-01-15 01:53:30 +09:00
Alexey Pustovalov
c12909f78f Migrate to PHP-FPM for all Web images 2025-01-14 15:32:46 +09:00
Alexey Pustovalov
11996bb529 Migrate to PHP-FPM for all Web images 2025-01-14 14:48:23 +09:00
Alexey Pustovalov
fb2f54d2e2 Migrate to PHP-FPM for all Web images 2025-01-14 02:53:25 +09:00
Alexey Pustovalov
b10947d72a Updated build procedure for Windows containers 2025-01-13 19:33:32 +09:00
Alexey Pustovalov
9b2975fddf Fixed sonarcloud project name 2025-01-13 19:30:38 +09:00
Alexey Pustovalov
1ec60a3b3f Fixed secrets reading from ENV for Zabbix agent2 and proxy (sqlite3) 2025-01-13 19:27:23 +09:00
Alexey Pustovalov
f239aec83f Migrate to PHP-FPM for all Web images 2025-01-13 19:24:39 +09:00
Alexey Pustovalov
1be587fab9 Updated build procedure for Windows containers 2025-01-12 01:27:20 +09:00
Alexey Pustovalov
675d34c612 Fixed minor issues with Windows containers 2025-01-11 17:45:05 +09:00
Alexey Pustovalov
99bf0c8a3a Removed deprecated 6.4 version from tag list 2025-01-10 18:14:15 +09:00
Alexey Pustovalov
a33d9ae106 Updated build procedure for Windows containers 2025-01-10 17:42:07 +09:00
Alexey Pustovalov
b0add345eb Fixed param substition in config files 2025-01-10 01:25:38 +09:00
Alexey Pustovalov
ac9cb5cdaa Using env variable for base image on all images 2025-01-08 16:49:55 +09:00
Alexey Pustovalov
9b0b16dab6 Added additional cipher (DHE-RSA-CHACHA20-POLY1305) for all Apache images 2025-01-08 15:52:28 +09:00
Alexey Pustovalov
5c60bb650e Fixed warning message about HTTP/2 on Alpine. Added additional cipher (DHE-RSA-CHACHA20-POLY1305) for all Nginx images 2025-01-08 15:43:20 +09:00
Alexey Pustovalov
fef0b3545f Fixed default CentOS base image 2025-01-08 15:38:45 +09:00
Alexey Pustovalov
3a16fe140e Updated env variables for building process 2025-01-06 17:30:38 +09:00
Alexey Pustovalov
e13c2068ad Updated env variables for building process 2025-01-06 17:29:23 +09:00
Alexey Pustovalov
aae532547e Updated env variables for building process 2025-01-06 17:24:57 +09:00
Alexey Pustovalov
d9b5a9b5e0 Fixed location for item_keys.conf for agent2 2025-01-02 21:50:46 +09:00
Alexey Pustovalov
3efae28ffd Fixed errors related to disabled Persistent buffer file on agent2 2025-01-02 20:58:14 +09:00
Alexey Pustovalov
daa1d4226b Fixed errors related to disabled Persistent buffer file on agent2 2025-01-02 20:55:53 +09:00
Alexey Pustovalov
4a412e608a Moved agent config files to appropriate place 2024-12-31 23:44:59 +09:00
Alexey Pustovalov
7a07971338 Fixed missing ListenPort for Zabbix agent 2 2024-12-31 23:40:49 +09:00
Alexey Pustovalov
3be164b37b Updated dependencies for Windows containers 2024-12-31 20:35:37 +09:00
Alexey Pustovalov
31131f0b5e Updated dependencies for Windows containers 2024-12-31 16:36:27 +09:00
Alexey Pustovalov
b799faec22 Updated dependencies for Windows containers 2024-12-31 14:07:12 +09:00
Alexey Pustovalov
0bd0867baf Updated dependencies for Windows containers 2024-12-31 13:02:42 +09:00
Alexey Pustovalov
44dcf6cfe6 Updated dependencies for Windows containers 2024-12-31 02:36:07 +09:00
Alexey Pustovalov
811ca70689 Fixed Windows containers building 2024-12-30 16:29:20 +00:00
Alexey Pustovalov
e62d67cacf Prepare for env variables in Windows containers 2024-12-30 20:17:45 +09:00
Alexey Pustovalov
ab18a9f39f Fixed Windows containers building 2024-12-30 10:39:43 +00:00
Alexey Pustovalov
6b6efc6f8a Updated Windows containers build process 2024-12-29 11:00:54 +00:00
Alexey Pustovalov
fb151f8cd6 Updated dependencies for Windows containers 2024-12-29 16:20:15 +09:00
Alexey Pustovalov
f0366df138 Prepare for env variable usage on Windows containers 2024-12-27 19:28:40 +09:00
Alexey Pustovalov
91150fde9a Prepare for env variable usage on Windows containers 2024-12-27 19:09:50 +09:00
Alexey Pustovalov
342916d3fc Prepare for env variable usage on Windows containers 2024-12-27 19:06:18 +09:00
Alexey Pustovalov
3295f2808b Prepare for env variable usage on Windows containers 2024-12-27 18:09:47 +09:00
Alexey Pustovalov
ec8a681966 Prepare for env variable usage on Windows containers 2024-12-27 17:59:46 +09:00
Alexey Pustovalov
785274df6d Using ADD instruction instead of PowerShell download 2024-12-27 17:33:12 +09:00
Alexey Pustovalov
f83936f69d Using ADD instruction instead of PowerShell download 2024-12-27 17:27:14 +09:00
Alexey Pustovalov
9fc396072b Using ADD instruction instead of PowerShell download 2024-12-27 17:23:51 +09:00
Alexey Pustovalov
7b8beabbf7 Using ADD instruction instead of PowerShell download 2024-12-27 17:20:00 +09:00
Alexey Pustovalov
3b2243cf15 Using ADD instruction instead of PowerShell download 2024-12-27 17:18:57 +09:00
Alexey Pustovalov
df1ebe9768 Using ADD instruction instead of PowerShell download 2024-12-27 16:46:13 +09:00
Alexey Pustovalov
5ff0e209b5 Using ADD instruction instead of PowerShell download 2024-12-27 16:28:43 +09:00
Alexey Pustovalov
82e7ce4688 Using ADD instruction instead of PowerShell download 2024-12-27 13:30:46 +09:00
Alexey Pustovalov
001f94fac4 Using ADD instruction instead of PowerShell download 2024-12-27 13:24:32 +09:00
Alexey Pustovalov
b428022ff0 Using ADD instruction instead of PowerShell download 2024-12-27 13:19:44 +09:00
Alexey Pustovalov
24e2138762 Using ADD instruction instead of PowerShell download 2024-12-27 13:17:13 +09:00
Alexey Pustovalov
a872962d36 Using ADD instruction instead of PowerShell download 2024-12-27 13:10:56 +09:00
Alexey Pustovalov
79af13df25 Using ADD instruction instead of PowerShell download 2024-12-27 12:49:39 +09:00
Alexey Pustovalov
5aa63e8a4a Added image for Windows Server 2025 2024-12-27 12:10:38 +09:00
Alexey Pustovalov
d9dacc64c8 Added image for Windows Server 2025 2024-12-27 12:09:37 +09:00
Alexey Pustovalov
de410ddf2d Sync bash code with 7.2 version 2024-12-27 01:56:09 +09:00
Alexey Pustovalov
829441dd0c Merge env variables for standard locations 2024-12-26 15:54:22 +09:00
Alexey Pustovalov
e23918cf57 Merge env variables for standard locations 2024-12-26 15:54:20 +09:00
Alexey Pustovalov
fa58f24f6e Fix /zabbix_agentd.d/ location for agent 2 2024-12-26 00:44:04 +09:00
Alexey Pustovalov
2a62353498 Fixed duplicate Include parameters for agent and agent2 images 2024-12-25 14:41:51 +09:00
Alexey Pustovalov
b7cb725fb3 Add verification for binary Zabbix components after installing dependencies 2024-12-25 14:28:21 +09:00
Alexey Pustovalov
397aeefb97 Added support for PostgreSQL database socket volume 2024-12-25 02:14:01 +09:00
Alexey Pustovalov
91825e34a4 Merge various changes with Zabbix 7.2 branch 2024-12-25 01:34:43 +09:00
Alexey Pustovalov
11fbb299b5 Merge various changes with Zabbix 7.2 branch 2024-12-25 01:29:57 +09:00
Alexey Pustovalov
8257994171 Move sources directory and introduce additional build context 2024-12-25 01:22:42 +09:00
Alexey Pustovalov
5730d6c0d2 Move sources directory and introduce additional build context 2024-12-25 01:18:43 +09:00
Alexey Pustovalov
4a9c6eb3c6 Move sources directory and introduce additional build context 2024-12-25 01:17:52 +09:00
Alexey Pustovalov
4840ebfe80 Added support for PostgreSQL database socket volume 2024-12-25 01:05:36 +09:00
Alexey Pustovalov
9ef4ed15bb Added config templates for Zabbix agent (Windows) 2024-12-24 19:03:27 +09:00
Alexey Pustovalov
a75ba3c057 Fix env variable for HeartbeatFrequency parameter 2024-12-24 14:01:13 +09:00
Alexey Pustovalov
d0bcd5d03e Fix default value for RefreshActiveChecks parameter 2024-12-24 13:56:05 +09:00
Alexey Pustovalov
33847a329d Updated compose files configuration for IPv6 2024-12-24 13:51:49 +09:00
Alexey Pustovalov
a556024d4c Fixed build error on server (PostgreSQL, Oracle Linux) 2024-12-24 12:05:57 +09:00
Alexey Pustovalov
b859cdcd98 Added missing parameters to env files 2024-12-24 02:50:47 +09:00
Alexey Pustovalov
63b3efb1c1 Env variables syntax for proxies 2024-12-23 23:19:01 +09:00
Alexey Pustovalov
340ddbdd9f Added missing variables to Web-service env file 2024-12-23 23:11:34 +09:00
Alexey Pustovalov
5c7ed677d2 Added missing Zabbix agent 2 status port 2024-12-23 23:08:35 +09:00
Alexey Pustovalov
7470fef082 Migrated images to use native Zabbix environment variables 2024-12-23 22:01:30 +09:00
Alexey Pustovalov
a01af62dff Migrated images to use native Zabbix environment variables 2024-12-23 21:23:06 +09:00
Alexey Pustovalov
c952d4ef69 Migrated images to use native Zabbix environment variables 2024-12-23 21:22:01 +09:00
Alexey Pustovalov
850cde0309 Added init services for DB schema create only to compose file 2024-12-21 21:19:17 +09:00
Alexey Pustovalov
0cad94f31e Added new plugin NVIDIA GPU 2024-12-21 03:02:58 +09:00
Alexey Pustovalov
527e146761 Fixed warning messages on Alpine (mysql->mariadb) during SQL queries 2024-12-20 18:43:46 +09:00
Alexey Pustovalov
0887b1094e Fixed runtime library on Ubuntu 2024-12-20 17:25:39 +09:00
Alexey Pustovalov
78705b4ab1 Added bash package to all images 2024-12-17 14:36:06 +09:00
Alexey Pustovalov
123d286845 Updated next Zabbix version to 7.4 2024-12-16 14:33:26 +09:00
Alexey Pustovalov
6bb4ef2339 Updated next Zabbix version to 7.4 2024-12-16 13:16:31 +09:00
Alexey Pustovalov
6cdeb7bc47 Prepare for Zabbix 7.2 release 2024-12-11 01:08:14 +09:00
Alexey Pustovalov
d5ef98f9f1 Removed orphaned commands 2024-12-08 02:35:19 +09:00
Alexey Pustovalov
0d46ce028c Added riscv64 arch for Alpine and Ubuntu images. Using openjdk17 for ppc64le on Alpine 2024-12-07 20:32:05 +09:00
Alexey Pustovalov
991a9b38df Updated Go lang on Ubuntu (noble), Nginx on RHEL like OS base images 2024-12-07 16:48:07 +09:00
Alexey Pustovalov
da22cf7a78 Fixed EXPOSE_WEB_SERVER_INFO parameter for Apache on Ubuntu 2024-12-06 22:11:25 +09:00
Alexey Pustovalov
1fd73dce18 Fixed RHEL base image cache 2024-12-06 17:41:18 +09:00
Alexey Pustovalov
cd3ab1a941 Fixed CentOS base image cache 2024-12-06 16:32:29 +09:00
Alexey Pustovalov
90fe04900b Updated PostgreSQL client to 17 version on Alpine 2024-12-06 16:27:48 +09:00
Alexey Pustovalov
380f7e94ea Updated Alpine version from 3.20 to 3.21 2024-12-06 14:20:01 +09:00
Alexey Pustovalov
2a116c3ce1 Removed duplicates for packages 2024-12-05 15:42:52 +09:00
Alexey Pustovalov
0d52aec96d Added firewall rule 2024-12-05 15:39:33 +09:00
dependabot[bot]
3de0455110 Bump actions/attest-build-provenance from 1 to 2
Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 1 to 2.
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](https://github.com/actions/attest-build-provenance/compare/v1...v2)

---
updated-dependencies:
- dependency-name: actions/attest-build-provenance
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-05 15:38:12 +09:00
Alexey Pustovalov
2592041985 Merge pull request #1580 from scottyah/kubernetes-autoscaler-fix
updated API version, parameter structure
2024-12-05 15:38:02 +09:00
Alexey Pustovalov
60c4e210fe Update SECURITY.md 2024-11-22 11:49:53 +09:00
Alexey Pustovalov
4aced036f8 Update SECURITY.md
Signed-off-by: Alexey Pustovalov <alexey.pustovalov@zabbix.com>
2024-11-22 11:49:26 +09:00
Alexey Pustovalov
2c8b85c3e0 Updated RHEL to 9.5 2024-11-14 15:27:37 +09:00
Alexey Pustovalov
8a62be2ac3 Using ENV variable for Buzybox image 2024-10-25 18:25:40 +09:00
Alexey Pustovalov
46d482071a Using ENV variable for Buzybox image 2024-10-25 18:22:40 +09:00
Alexey Pustovalov
a29fe86268 Using ENV variable for Buzybox image 2024-10-25 17:14:02 +09:00
Alexey Pustovalov
18117848d9 Fixed build CentOS base images 2024-10-23 16:55:43 +09:00
Alexey Pustovalov
b8a6510b88 Fixed build on RHEL and OEL 2024-10-23 12:46:57 +09:00
Alexey Pustovalov
eb8bc59778 Updated curl for Windows Zabbix agent 2024-10-23 00:18:32 +09:00
Alexey Pustovalov
987fcdda07 Fixed build on RHEL and OEL 2024-10-23 00:14:13 +09:00
Alexey Pustovalov
113fad9e82 Updated GO Lang for Windows 2024-10-22 14:42:34 +09:00
Alexey Pustovalov
0015128e15 Fixed possible injection of traps in trap receiver 2024-10-02 00:35:21 +09:00
Alexey Pustovalov
e316e552ac Updated OpenSSL to 3.3.2 for Windows 2024-09-27 13:40:15 +09:00
Alexey Pustovalov
2fceec51e8 Fixed PHP error logging 2024-09-24 14:22:58 +09:00
Alexey Pustovalov
c378cdbc2e Removed static user for Zabbix snmptraps image 2024-09-24 14:01:07 +09:00
Alexey Pustovalov
6708993fb2 Using long syntax to expose ports 2024-09-20 01:25:55 +09:00
Alexey Pustovalov
9ff5350de3 Added hostname package for CentOS images 2024-09-18 01:17:42 +09:00
Alexey Pustovalov
2f0b2c44f3 Fixed NotoSansCJKjp fonts URL 2024-08-27 13:56:33 +09:00
Alexey Pustovalov
af3b2aba73 Fixed NotoSansCJKjp fonts URL 2024-08-27 01:02:32 +09:00
Alexey Pustovalov
f169159b53 Added ZBX_TLS variables to specify data without attached volume with encryption files 2024-08-21 20:26:24 +09:00
Alexey Pustovalov
09fc37682b Clear ZBX, DB env variables before starting agent, server, proxy and web-service 2024-08-20 18:09:56 +09:00
Alexey Pustovalov
00c3ad8c3e Added build arg for CFLAGS 2024-08-15 16:48:24 +09:00
Alexey Pustovalov
07fbd9e7d5 Updated cosign version 2024-08-14 17:47:58 +09:00
Alexey Pustovalov
b06ec9b209 Updated cosign version 2024-08-14 17:47:50 +09:00
Alexey Pustovalov
95fefe1bc4 Merge pull request #1489 from DemoYeti/patch-1
chore: use better `alt` for logo
2024-08-14 17:39:36 +09:00
Alexey Pustovalov
b6266b4060 Merge pull request #1485 from zabbix/dependabot/github_actions/actions/upload-artifact-4.3.6
Bump actions/upload-artifact from 4.3.4 to 4.3.6
2024-08-14 17:38:37 +09:00
Alexey Pustovalov
b3781bc08f Merge pull request #1491 from zabbix/dependabot/github_actions/github/codeql-action-3.26.1
Bump github/codeql-action from 3.25.11 to 3.26.1
2024-08-14 17:38:27 +09:00
Alexey Pustovalov
7d352bcfbc Merge pull request #1492 from zabbix/dependabot/github_actions/docker/build-push-action-6.7.0
Bump docker/build-push-action from 6.3.0 to 6.7.0
2024-08-14 17:37:37 +09:00
Alexey Pustovalov
7819ec2df4 Merge pull request #1487 from zabbix/dependabot/github_actions/sigstore/cosign-installer-3.6.0
Bump sigstore/cosign-installer from 3.4.0 to 3.6.0
2024-08-14 17:37:12 +09:00
Alexey Pustovalov
39e9e5a42c Merge pull request #1483 from zabbix/dependabot/github_actions/step-security/harden-runner-2.9.1
Bump step-security/harden-runner from 2.8.1 to 2.9.1
2024-08-14 17:36:35 +09:00
Alexey Pustovalov
b0f30485a1 Added possibility to build images from local source direactory 2024-08-14 16:50:44 +09:00
Alexey Pustovalov
434531ef13 Added possibility to build images from local source direactory 2024-08-14 16:40:30 +09:00
Alexey Pustovalov
622f09af12 Merge pull request #1478 from zabbix/sokurenko/7.0
Fixed build failure with local branch due to missing plugins branch with same name by allowing ZBX_PLUGINS_VERSION argument
2024-07-31 12:22:25 +09:00
Alexey Pustovalov
a09458cecd Fixed missing hostname package for OL 2024-07-29 16:53:04 +09:00
Alexey Pustovalov
d1961d355b Using audit mode to learn new CentOS repo 2024-07-29 15:50:40 +09:00
Alexey Pustovalov
7957d40981 Fixed ZBX_STARTIPMIPOLLERS param name 2024-07-29 14:12:40 +09:00
Alexey Pustovalov
11c33b8007 Removed vulnerability scanner 2024-07-24 18:37:03 +09:00
Alexey Pustovalov
50ebc1abbc Added vulnerability scanner 2024-07-24 18:29:09 +09:00
Alexey Pustovalov
7a9e42a895 Use latest available PHP version (8.2) on EL and derivatives 2024-07-23 18:13:50 +09:00
Alexey Pustovalov
6b1d6cfd96 Fixed usage Vault with non-vault DB credentials 2024-07-22 16:51:42 +09:00
Alexey Pustovalov
3debbfd114 Fixed restart Web Nginx on Ubuntu under root 2024-07-18 21:05:56 +09:00
Pustovalov Alexey
a8136afac4 Updated versions of GitHub actions 2024-07-08 13:31:41 +03:00
Alexey Pustovalov
1648ad9543 Fixed Nginx images running under root 2024-07-05 13:21:12 +09:00
Alexey Pustovalov
2476dd7c17 Fixed warnings for snmtraps image 2024-06-21 13:46:09 +09:00
Alexey Pustovalov
51dfece057 Updated snmptrapd configuration 2024-06-13 13:47:28 +09:00
Alexey Pustovalov
31790a1a21 Updated snmptrapd configuration 2024-06-13 13:44:50 +09:00
Alexey Pustovalov
e7c6db4031 Fixed start MySQL container for PostgreSQL versions 2024-06-12 11:44:35 +09:00
Alexey Pustovalov
dccd98d982 Updated MySQL to 8.4 2024-06-11 18:33:55 +09:00
Alexey Pustovalov
b4998a9d5d Using Selenium Hub to support different browsers 2024-06-10 16:32:50 +09:00
Alexey Pustovalov
6550ed32a3 Removed orphaned commands from ubuntu image 2024-06-04 19:01:50 +09:00
Alexey Pustovalov
9fbb426465 Fixed license copy action for Java Gateway on RHEL 2024-06-04 16:31:08 +09:00
Alexey Pustovalov
189c4efb7d Updated next major master release to 7.2 2024-06-04 15:09:07 +09:00
Alexey Pustovalov
824c95a32e Updated master / trunk versions 2024-06-04 15:00:30 +09:00
546 changed files with 19039 additions and 11634 deletions

40
.env
View File

@ -1,10 +1,10 @@
# Zabbix images
ZABBIX_ALPINE_IMAGE_TAG=alpine
ZABBIX_CENTOS_IMAGE_TAG=centos
ZABBIX_OL_IMAGE_TAG=ol
ZABBIX_UBUNTU_IMAGE_TAG=ubuntu
ZABBIX_RHEL_IMAGE_TAG=rhel
ZABBIX_IMAGE_TAG_POSTFIX=-trunk
ZABBIX_ALPINE_IMAGE_TAG=alpine-7.4
ZABBIX_CENTOS_IMAGE_TAG=centos-7.4
ZABBIX_OL_IMAGE_TAG=ol-7.4
ZABBIX_UBUNTU_IMAGE_TAG=ubuntu-7.4
ZABBIX_RHEL_IMAGE_TAG=rhel-7.4
ZABBIX_IMAGE_TAG_POSTFIX=-latest
ZABBIX_LOCAL_IMAGE_TAG_POSTFIX=-local
ZABBIX_SERVER_MYSQL_IMAGE=zabbix/zabbix-server-mysql
@ -23,17 +23,24 @@ ZABBIX_WEB_SERVICE_IMAGE=zabbix/zabbix-web-service
# Database images
MYSQL_IMAGE=mysql
MYSQL_IMAGE_TAG=8.0-oracle
MYSQL_IMAGE_TAG=8.4-oracle
POSTGRESQL_IMAGE=postgres
POSTGRESQL_IMAGE_TAG=16-alpine
POSTGRESQL_IMAGE_TAG=17-alpine
#POSTGRESQL_IMAGE=timescale/timescaledb
#POSTGRESQL_IMAGE_TAG=2.14.2-pg16
#POSTGRESQL_IMAGE_TAG=2.18.1-pg17
BUSYBOX_IMAGE=busybox
BUSYBOX_IMAGE_TAG=latest
ELASTICSEARCH_IMAGE=elasticsearch
ELASTICSEARCH_IMAGE_TAG=latest
WEBDRIVER_IMAGE=selenium/standalone-chrome
WEBDRIVER_IMAGE_TAG=latest
WEBDRIVER_IMAGE=selenium/hub
WEBDRIVER_IMAGE_TAG=4.21.0
WEBDRIVER_CHROME_IMAGE=selenium/node-chrome
WEBDRIVER_CHROME_IMAGE_TAG=125.0
WEBDRIVER_FIREFOX_IMAGE=selenium/node-firefox
WEBDRIVER_FIREFOX_IMAGE_TAG=126.0
# Expose ports per service
ZABBIX_SERVER_PORT=10051
@ -45,6 +52,7 @@ ZABBIX_WEB_APACHE_HTTP_PORT=8081
ZABBIX_WEB_APACHE_HTTPS_PORT=8443
ZABBIX_AGENT_PORT=10050
ZABBIX_AGENT2_PORT=10060
ZABBIX_AGENT2_STATUS_PORT=31999
ZABBIX_JAVA_GATEWAY_PORT=10052
ZABBIX_SNMPTRAPS_PORT=162
ZABBIX_WEB_SERVICE_PORT=10053
@ -70,11 +78,11 @@ ENV_VARS_DIRECTORY=./env_vars
RESTART_POLICY=unless-stopped
# Cache base images
ALPINE_CACHE_FROM=alpine:3.20
CENTOS_CACHE_FROM=quay.io/centos/centos:stream9
OL_CACHE_FROM=oraclelinux:9-slim
UBUNTU_CACHE_FROM=ubuntu:noble
RHEL_CACHE_FROM=registry.access.redhat.com/ubi9/ubi-minimal:9.4
ALPINE_BASE_IMAGE=alpine:3.23
CENTOS_BASE_IMAGE=quay.io/centos/centos:stream10-minimal
OL_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
UBUNTU_BASE_IMAGE=ubuntu:noble
RHEL_BASE_IMAGE=registry.access.redhat.com/ubi10/ubi-minimal:10.1
# Base images
BUILD_BASE_IMAGE=zabbix-build-base

View File

@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo: true
egress-policy: block
@ -27,6 +27,6 @@ jobs:
github.com:443
- name: 'Checkout Repository'
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: 'Dependency Review'
uses: actions/dependency-review-action@be8bc500ee15e96754d2a6f2d34be14e945a46f3 # v4.1.2
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2

View File

@ -48,7 +48,7 @@ jobs:
- web-service
steps:
- name: Block egress traffic
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo: true
egress-policy: block
@ -57,12 +57,12 @@ jobs:
hub.docker.com:443
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
- name: Update DockerHub repo description (zabbix-${{ matrix.component }})
uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae # v4.0.0
uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

View File

@ -64,7 +64,7 @@ jobs:
sha_short: ${{ steps.branch_info.outputs.sha_short }}
steps:
- name: Block egress traffic
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo: true
egress-policy: block
@ -72,9 +72,10 @@ jobs:
api.github.com:443
github.com:443
objects.githubusercontent.com:443
release-assets.githubusercontent.com:443
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ env.TRUNK_ONLY_EVENT == 'true' && env.TRUNK_GIT_BRANCH || '' }}
fetch-depth: 1
@ -175,17 +176,20 @@ jobs:
attestations: write
steps:
- name: Block egress traffic
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo: true
egress-policy: block
egress-policy: audit
allowed-endpoints: >
api.github.com:443
release-assets.githubusercontent.com:443
archive.ubuntu.com:80
atl.mirrors.knownhost.com:443
atl.mirrors.knownhost.com:80
auth.docker.io:443
cdn03.quay.io:443
cdn01.quay.io:443
cdn02.quay.io:443
centos-stream-distro.1gservers.com:443
centos-stream-distro.1gservers.com:80
dfw.mirror.rackspace.com:443
@ -263,31 +267,31 @@ jobs:
yum.oracle.com:443
ziply.mm.fcix.net:443
pkg-containers.githubusercontent.com:443
raw.githubusercontent.com:443
timestamp.sigstore.dev:443
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ env.TRUNK_ONLY_EVENT == 'true' && env.TRUNK_GIT_BRANCH || '' }}
fetch-depth: 1
- name: Install cosign
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4
with:
cosign-release: 'v2.2.3'
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad
- name: Check cosign version
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
run: cosign version
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
image: tonistiigi/binfmt:latest
image: tonistiigi/binfmt:qemu-v10.0.4
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
with:
driver-opts: image=moby/buildkit:master
@ -308,7 +312,7 @@ jobs:
- name: Generate tags
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: |
${{ format('{0}/{1}/{2}{3}', env.DOCKER_REGISTRY_TEST, env.DOCKER_REPOSITORY_TEST, env.IMAGES_PREFIX, env.BASE_BUILD_NAME ) }},enable=${{ env.AUTO_PUSH_IMAGES != 'true' }}
@ -359,14 +363,14 @@ jobs:
- name: Login to DockerHub
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ${{ env.DOCKER_REGISTRY_TEST }}
if: ${{ env.AUTO_PUSH_IMAGES != 'true' }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ${{ env.DOCKER_REGISTRY_TEST }}
username: ${{ github.actor }}
@ -374,7 +378,7 @@ jobs:
- name: Build and publish image
id: docker_build
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
context: ${{ format('{0}/{1}/{2}', env.DOCKERFILES_DIRECTORY, env.BASE_BUILD_NAME, matrix.os) }}
file: ${{ format('{0}/{1}/{2}/Dockerfile', env.DOCKERFILES_DIRECTORY, env.BASE_BUILD_NAME, matrix.os) }}
@ -386,8 +390,14 @@ jobs:
labels: |
org.opencontainers.image.revision=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
org.opencontainers.image.created=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
cache-from: ${{ steps.cache_data.outputs.cache_from }}
cache-to: ${{ steps.cache_data.outputs.cache_to }}
- name: Scan for vulnerabilities
if: ${{ matrix.os != 'centos' }}
uses: crazy-max/ghaction-container-scan@v3
with:
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
annotations: true
dockerfile: ${{ format('{0}/{1}/{2}/Dockerfile', env.DOCKERFILES_DIRECTORY, env.BASE_BUILD_NAME, matrix.os) }}
- name: Sign the images with GitHub OIDC Token
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
@ -412,7 +422,7 @@ jobs:
- name: Attest images
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
id: attest
uses: actions/attest-build-provenance@v1
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ format('{0}/{1}/{2}{3}', env.DOCKER_REGISTRY, env.DOCKER_REPOSITORY, env.IMAGES_PREFIX, env.BASE_BUILD_NAME ) }}
subject-digest: ${{ steps.docker_build.outputs.digest }}
@ -433,13 +443,13 @@ jobs:
echo "${METADATA}" > "$CACHE_FILE_NAME"
- name: Cache image metadata
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ env.BASE_CACHE_FILE_NAME }}
key: ${{ env.BASE_BUILD_NAME }}-${{ matrix.os }}-${{ github.run_id }}
build_base_database:
timeout-minutes: 180
timeout-minutes: 1240
needs: [ "build_base", "init_build"]
name: Build ${{ matrix.build }} base on ${{ matrix.os }}
strategy:
@ -455,12 +465,13 @@ jobs:
attestations: write
steps:
- name: Block egress traffic
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
release-assets.githubusercontent.com:443
auth.docker.io:443
git.zabbix.com:443
github.com:443
@ -468,11 +479,13 @@ jobs:
go.mongodb.org:443
golang.org:443
google.golang.org:443
sum.golang.org:443
golang.zabbix.com:443
sum.golang.org:443
gopkg.in:443
ghcr.io:443
index.docker.io:443
noto-website.storage.googleapis.com:443
noto-website-2.storage.googleapis.com:443
production.cloudflare.docker.com:443
proxy.golang.org:443
registry-1.docker.io:443
@ -483,31 +496,31 @@ jobs:
tuf-repo-cdn.sigstore.dev:443
rekor.sigstore.dev:443
pkg-containers.githubusercontent.com:443
raw.githubusercontent.com:443
timestamp.sigstore.dev:443
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ env.TRUNK_ONLY_EVENT == 'true' && env.TRUNK_GIT_BRANCH || '' }}
fetch-depth: 1
- name: Install cosign
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4
with:
cosign-release: 'v2.2.3'
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad
- name: Check cosign version
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
run: cosign version
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
image: tonistiigi/binfmt:latest
image: tonistiigi/binfmt:qemu-v10.0.4
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
with:
driver-opts: image=moby/buildkit:master
@ -528,7 +541,7 @@ jobs:
- name: Generate tags
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: |
${{ format('{0}/{1}/{2}{3}', env.DOCKER_REGISTRY_TEST, env.DOCKER_REPOSITORY_TEST, env.IMAGES_PREFIX, matrix.build ) }},enable=${{ env.AUTO_PUSH_IMAGES != 'true' }}
@ -546,7 +559,7 @@ jobs:
latest=${{ (matrix.os == 'alpine') && (!contains(fromJSON('["workflow_dispatch"]'), github.event_name)) && ( needs.init_build.outputs.is_default_branch == 'true' ) }}
- name: Download metadata of ${{ env.BASE_BUILD_NAME }}:${{ matrix.os }}
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ env.BASE_CACHE_FILE_NAME }}
key: ${{ env.BASE_BUILD_NAME }}-${{ matrix.os }}-${{ github.run_id }}
@ -622,14 +635,14 @@ jobs:
- name: Login to DockerHub
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to ${{ env.DOCKER_REGISTRY_TEST }}
if: ${{ env.AUTO_PUSH_IMAGES != 'true' }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ${{ env.DOCKER_REGISTRY_TEST }}
username: ${{ github.actor }}
@ -637,9 +650,12 @@ jobs:
- name: Build ${{ matrix.build }}/${{ matrix.os }} and push
id: docker_build
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
context: ${{ format('{0}/{1}/{2}/', env.DOCKERFILES_DIRECTORY, matrix.build, matrix.os) }}
build-contexts: |
sources=./sources/
config_templates=./config_templates/
file: ${{ format('{0}/{1}/{2}/Dockerfile', env.DOCKERFILES_DIRECTORY, matrix.build, matrix.os) }}
platforms: ${{ steps.platform.outputs.list }}
push: true
@ -674,7 +690,7 @@ jobs:
- name: Attest images
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
id: attest
uses: actions/attest-build-provenance@v1
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ format('{0}/{1}/{2}{3}', env.DOCKER_REGISTRY, env.DOCKER_REPOSITORY, env.IMAGES_PREFIX, matrix.build ) }}
subject-digest: ${{ steps.docker_build.outputs.digest }}
@ -695,7 +711,7 @@ jobs:
echo "${METADATA}" > "$CACHE_FILE_NAME"
- name: Cache image metadata
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ env.BUILD_CACHE_FILE_NAME }}
key: ${{ matrix.build }}-${{ matrix.os }}-${{ github.run_id }}
@ -718,12 +734,14 @@ jobs:
attestations: write
steps:
- name: Block egress traffic
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
release-assets.githubusercontent.com:443
apt.postgresql.org:80
auth.docker.io:443
dl-cdn.alpinelinux.org:443
github.com:443
@ -739,6 +757,8 @@ jobs:
atl.mirrors.knownhost.com:80
auth.docker.io:443
cdn03.quay.io:443
cdn02.quay.io:443
cdn01.quay.io:443
centos-stream-distro.1gservers.com:443
centos-stream-distro.1gservers.com:80
download.cf.centos.org:443
@ -838,31 +858,31 @@ jobs:
tuf-repo-cdn.sigstore.dev:443
rekor.sigstore.dev:443
pkg-containers.githubusercontent.com:443
raw.githubusercontent.com:443
timestamp.sigstore.dev:443
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ env.TRUNK_ONLY_EVENT == 'true' && env.TRUNK_GIT_BRANCH || '' }}
fetch-depth: 1
- name: Install cosign
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4
with:
cosign-release: 'v2.2.3'
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad
- name: Check cosign version
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
run: cosign version
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
image: tonistiigi/binfmt:latest
image: tonistiigi/binfmt:qemu-v10.0.4
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
with:
driver-opts: image=moby/buildkit:master
@ -879,6 +899,9 @@ jobs:
# Chromium on Ubuntu is not available on s390x and armhf platform
elif [ "$MATRIX_OS" == "ubuntu" ] && [ "$MATRIX_BUILD" == "web-service" ]; then
platform_list="linux/amd64,linux/arm64"
# Chromium on Oracle Linux is available only on amd64 platform
elif [ "$MATRIX_OS" == "ol" ] && [ "$MATRIX_BUILD" == "web-service" ]; then
platform_list="linux/amd64"
else
platform_list=$(jq -r ".[\"os-linux\"].\"$MATRIX_OS\" | join(\",\")" "$MATRIX_FILE")
fi
@ -912,7 +935,7 @@ jobs:
- name: Generate tags
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: |
${{ format('{0}/{1}/{2}{3}', env.DOCKER_REGISTRY_TEST, env.DOCKER_REPOSITORY_TEST, env.IMAGES_PREFIX, matrix.build ) }},enable=${{ env.AUTO_PUSH_IMAGES != 'true' }}
@ -930,7 +953,7 @@ jobs:
latest=${{ (matrix.os == 'alpine') && (!contains(fromJSON('["workflow_dispatch"]'), github.event_name)) && ( needs.init_build.outputs.is_default_branch == 'true' ) }}
- name: Download metadata of ${{ steps.build_base_image.outputs.build_base }}:${{ matrix.os }}
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
if: ${{ matrix.build != 'snmptraps' }}
with:
path: ${{ env.BUILD_CACHE_FILE_NAME }}
@ -994,14 +1017,14 @@ jobs:
- name: Login to DockerHub
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push image
id: docker_build
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
context: ${{ format('{0}/{1}/{2}', env.DOCKERFILES_DIRECTORY, matrix.build, matrix.os) }}
file: ${{ format('{0}/{1}/{2}/Dockerfile', env.DOCKERFILES_DIRECTORY, matrix.build, matrix.os) }}
@ -1038,7 +1061,7 @@ jobs:
- name: Attest images
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
id: attest
uses: actions/attest-build-provenance@v1
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ format('{0}/{1}/{2}{3}', env.DOCKER_REGISTRY, env.DOCKER_REPOSITORY, env.IMAGES_PREFIX, matrix.build ) }}
subject-digest: ${{ steps.docker_build.outputs.digest }}

View File

@ -72,7 +72,7 @@ jobs:
secret_prefix: ${{ steps.branch_info.outputs.secret_prefix }}
steps:
- name: Block egress traffic
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo: true
egress-policy: block
@ -80,9 +80,10 @@ jobs:
api.github.com:443
github.com:443
objects.githubusercontent.com:443
release-assets.githubusercontent.com:443
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
sparse-checkout: ${{ env.MATRIX_FILE }}
@ -213,15 +214,15 @@ jobs:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
- name: Install cosign
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad
with:
cosign-release: 'v2.2.3'
cosign-release: 'v2.4.0'
- name: Check cosign version
if: ${{ env.AUTO_PUSH_IMAGES == 'true' }}
@ -236,7 +237,7 @@ jobs:
- name: Generate tags
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: ${{ env.IMAGES_PREFIX }}${{ matrix.build }}
tags: |
@ -281,7 +282,7 @@ jobs:
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
- name: Cache image metadata
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: |
${{ env.BASE_BUILD_NAME }}_${{ matrix.arch }}_tag_id
@ -344,7 +345,7 @@ jobs:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
@ -356,7 +357,7 @@ jobs:
echo "arch=${ARCH,,}" >> $GITHUB_OUTPUT
- name: Download metadata of ${{ env.BASE_BUILD_NAME }}:${{ matrix.arch }}
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: |
${{ env.BASE_BUILD_NAME }}_${{ matrix.arch }}_tag_id
@ -394,7 +395,7 @@ jobs:
- name: Generate tags
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: ${{ env.IMAGES_PREFIX }}${{ matrix.build }}
tags: |
@ -409,9 +410,11 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
containerfiles: |
${{ env.DOCKERFILES_DIRECTORY }}/${{ matrix.build }}/rhel/Dockerfile
build-args: BUILD_BASE_IMAGE=${{ steps.base_build.outputs.base_build_image }}
build-args: BUILD_BASE_IMAGE=localhost/${{ steps.base_build.outputs.base_build_image }}
extra-args: |
--iidfile=${{ github.workspace }}/iidfile
--build-context sources=./sources/
--build-context config_templates=./config_templates/
- name: Prepare image metadata
id: image_metadata
@ -439,7 +442,7 @@ jobs:
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
- name: Cache image metadata
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: |
${{ matrix.build }}_${{ matrix.arch }}_tag_id
@ -502,7 +505,7 @@ jobs:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
@ -536,7 +539,7 @@ jobs:
- name: Download metadata of ${{ steps.build_base_image.outputs.build_base }}:${{ matrix.arch }}
if: ${{ matrix.build != 'snmptraps' }}
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: |
${{ steps.build_base_image.outputs.build_base }}_${{ matrix.arch }}_tag_id
@ -581,7 +584,7 @@ jobs:
- name: Generate tags
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: ${{ env.REGISTRY }}/${{ env.REGISTRY_NAMESPACE }}/${{ secrets[format('{0}_{1}_PROJECT', needs.init_build.outputs.secret_prefix, steps.var_format.outputs.matrix_build)] || matrix.build }}
tags: |
@ -604,9 +607,8 @@ jobs:
containerfiles: |
${{ env.DOCKERFILES_DIRECTORY }}/${{ matrix.build }}/rhel/Dockerfile
extra-args: |
--pull
--iidfile=${{ github.workspace }}/iidfile
build-args: BUILD_BASE_IMAGE=${{ steps.base_build.outputs.base_build_image }}
build-args: BUILD_BASE_IMAGE=localhost/${{ steps.base_build.outputs.base_build_image }}
- name: Log in to ${{ env.REGISTRY }}
uses: redhat-actions/podman-login@9184318aae1ee5034fbfbacc0388acf12669171f # v1.6
@ -648,7 +650,7 @@ jobs:
--env PFLT_LOGLEVEL=$PFLT_LOGLEVEL \
--env PFLT_ARTIFACTS=/artifacts \
--env PFLT_LOGFILE=/artifacts/preflight.log \
--env PFLT_CERTIFICATION_PROJECT_ID=$PFLT_CERTIFICATION_PROJECT_ID \
--env PFLT_CERTIFICATION_COMPONENT_ID=$PFLT_CERTIFICATION_PROJECT_ID \
--env PFLT_PYXIS_API_TOKEN=$PFLT_PYXIS_API_TOKEN \
--env PFLT_DOCKERCONFIG=/temp-authfile.json \
-v $PFLT_ARTIFACTS:/artifacts \
@ -718,7 +720,7 @@ jobs:
permissions: {}
steps:
- name: Download metadata of ${{ matrix.build }}:${{ matrix.arch }}
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: |
${{ matrix.build }}_${{ matrix.arch }}_tag_id
@ -739,7 +741,7 @@ jobs:
echo "::endgroup::"
- name: Download metadata of ${{ env.BASE_BUILD_NAME }}:${{ matrix.arch }}
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: |
${{ env.BASE_BUILD_NAME }}_${{ matrix.arch }}_tag_id

View File

@ -9,6 +9,7 @@ on:
- '[0-9]+.[0-9]+'
- 'trunk'
paths:
- 'build.json'
- 'Dockerfiles/*/windows/*'
- '!**/README.md'
- '.github/workflows/images_build_windows.yml'
@ -34,8 +35,7 @@ env:
IMAGES_PREFIX: "zabbix-"
MSFT_BASE_BUILD_IMAGE: "mcr.microsoft.com/windows/servercore"
PWSH_BASE_IMAGE_NAME: "mcr.microsoft.com/powershell"
PWSH_BASE_IMAGE_PREFIX: "lts-nanoserver-"
OS_BASE_IMAGE_NAME: "mcr.microsoft.com/windows/nanoserver"
BASE_IMAGE_NAME: "build-base"
BASE_BUILD_IMAGE_NAME: "build-mysql"
@ -60,15 +60,16 @@ jobs:
sha_short: ${{ steps.branch_info.outputs.sha_short }}
steps:
- name: Block egress traffic
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
github.com:443
release-assets.githubusercontent.com:443
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ env.TRUNK_ONLY_EVENT == 'true' && env.TRUNK_GIT_BRANCH || '' }}
fetch-depth: 1
@ -157,21 +158,21 @@ jobs:
component: ${{ fromJson(needs.init_build.outputs.components) }}
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ env.TRUNK_ONLY_EVENT == 'true' && env.TRUNK_GIT_BRANCH || '' }}
fetch-depth: 1
- name: Install cosign
uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad
with:
cosign-release: 'v2.2.3'
cosign-release: 'v2.4.0'
- name: Check cosign version
run: cosign version
- name: Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
@ -192,7 +193,7 @@ jobs:
- name: Generate tags
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGES_PREFIX }}${{ env.BASE_IMAGE_NAME }}
context: ${{ env.TRUNK_ONLY_EVENT == 'true' && 'git' || '' }}
@ -248,7 +249,7 @@ jobs:
Write-Host @"
docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION
--label org.opencontainers.image.created=$Env:LABEL_CREATED
--build-arg=BUILD_BASE_IMAGE=$base_os_image
--build-arg=OS_BASE_IMAGE=$base_os_image
--file=$dockerfile
$tags
$context
@ -256,7 +257,7 @@ jobs:
docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION `
--label org.opencontainers.image.created=$Env:LABEL_CREATED `
--build-arg=BUILD_BASE_IMAGE=$base_os_image `
--build-arg=OS_BASE_IMAGE=$base_os_image `
--file=$dockerfile `
$tags `
$context
@ -326,7 +327,7 @@ jobs:
$Env:DIGEST | Set-Content -Path $Env:CACHE_FILE_NAME
- name: Cache image digest
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ env.BASE_IMAGE_NAME }}_${{ matrix.os }}_${{ matrix.component }}
key: ${{ env.BASE_IMAGE_NAME }}-${{ matrix.os }}-${{ github.run_id }}
@ -347,21 +348,21 @@ jobs:
component: ${{ fromJson(needs.init_build.outputs.components) }}
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ env.TRUNK_ONLY_EVENT == 'true' && env.TRUNK_GIT_BRANCH || '' }}
fetch-depth: 1
- name: Install cosign
uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad
with:
cosign-release: 'v2.2.3'
cosign-release: 'v2.4.0'
- name: Check cosign version
run: cosign version
- name: Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
@ -382,7 +383,7 @@ jobs:
- name: Generate tags
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGES_PREFIX }}${{ env.BASE_BUILD_IMAGE_NAME }}
context: ${{ env.TRUNK_ONLY_EVENT == 'true' && 'git' || '' }}
@ -398,7 +399,7 @@ jobs:
latest=false
- name: Download SHA256 tag of ${{ env.BASE_IMAGE_NAME }}:${{ matrix.os }}
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ env.BASE_IMAGE_NAME }}_${{ matrix.os }}_${{ matrix.component }}
key: ${{ env.BASE_IMAGE_NAME }}-${{ matrix.os }}-${{ github.run_id }}
@ -554,7 +555,7 @@ jobs:
$Env:DIGEST | Set-Content -Path $Env:CACHE_FILE_NAME
- name: Cache image digest
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ env.BASE_BUILD_IMAGE_NAME }}_${{ matrix.os }}_${{ matrix.component }}
key: ${{ env.BASE_BUILD_IMAGE_NAME }}-${{ matrix.os }}-${{ github.run_id }}
@ -575,21 +576,21 @@ jobs:
component: ${{ fromJson(needs.init_build.outputs.components) }}
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ env.TRUNK_ONLY_EVENT == 'true' && env.TRUNK_GIT_BRANCH || '' }}
fetch-depth: 1
- name: Install cosign
uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad
with:
cosign-release: 'v2.2.3'
cosign-release: 'v2.4.0'
- name: Check cosign version
run: cosign version
- name: Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
@ -610,7 +611,7 @@ jobs:
- name: Generate tags
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGES_PREFIX }}${{ matrix.component }}
context: ${{ env.TRUNK_ONLY_EVENT == 'true' && 'git' || '' }}
@ -626,7 +627,7 @@ jobs:
latest=false
- name: Download SHA256 tag of ${{ env.BASE_BUILD_IMAGE_NAME }}:${{ matrix.os }}
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ env.BASE_BUILD_IMAGE_NAME }}_${{ matrix.os }}_${{ matrix.component }}
key: ${{ env.BASE_BUILD_IMAGE_NAME }}-${{ matrix.os }}-${{ github.run_id }}
@ -674,8 +675,7 @@ jobs:
BASE_BUILD_OS_TAG: ${{ steps.base_os_tag.outputs.os_tag }}
LABEL_REVISION: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
LABEL_CREATED: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
PWSH_BASE_IMAGE_NAME: ${{ env.PWSH_BASE_IMAGE_NAME }}
PWSH_BASE_IMAGE_PREFIX: ${{ env.PWSH_BASE_IMAGE_PREFIX }}
OS_BASE_IMAGE_NAME: ${{ env.OS_BASE_IMAGE_NAME }}
AUTO_PUSH_IMAGES: ${{ env.AUTO_PUSH_IMAGES }}
run: |
echo "::group::Docker version"
@ -696,8 +696,8 @@ jobs:
# PowerShell images based on LTSC 2019 and LTSC 2016 do not have "ltsc" prefix
$os_tag_suffix=$Env:BASE_BUILD_OS_TAG
$os_tag_suffix=$os_tag_suffix -replace "ltsc2019",'1809'
$base_image=$Env:PWSH_BASE_IMAGE_NAME + ':' + $Env:PWSH_BASE_IMAGE_PREFIX + $os_tag_suffix
# $os_tag_suffix=$os_tag_suffix -replace "ltsc2019",'1809'
$base_image=$Env:OS_BASE_IMAGE_NAME + ':' + $os_tag_suffix
echo "::group::Image tags"
echo "$Env:TAGS"
@ -716,7 +716,7 @@ jobs:
docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION
--label org.opencontainers.image.created=$Env:LABEL_CREATED
--build-arg=BUILD_BASE_IMAGE=$base_build_image
--build-arg=BASE_IMAGE=$base_image
--build-arg=OS_BASE_IMAGE=$base_image
--file=$dockerfile
$tags
$context
@ -725,7 +725,7 @@ jobs:
docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION `
--label org.opencontainers.image.created=$Env:LABEL_CREATED `
--build-arg=BUILD_BASE_IMAGE=$base_build_image `
--build-arg=BASE_IMAGE=$base_image `
--build-arg=OS_BASE_IMAGE=$base_image `
--file=$dockerfile `
$tags `
$context

View File

@ -34,7 +34,7 @@ jobs:
zabbix_release: ${{ steps.branch_info.outputs.zabbix_release }}
steps:
- name: Block egress traffic
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo: true
egress-policy: block
@ -42,7 +42,7 @@ jobs:
github.com:443
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
sparse-checkout: ${{ env.MATRIX_FILE }}
@ -98,7 +98,7 @@ jobs:
component: ${{ fromJson(needs.init.outputs.components) }}
steps:
- name: Block egress traffic
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo: true
egress-policy: block
@ -109,7 +109,7 @@ jobs:
pypi.org:443
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
@ -127,7 +127,7 @@ jobs:
echo "matrix_build=${MATRIX_BUILD}" >> $GITHUB_OUTPUT
- name: Setup Python 3.x
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.x'

View File

@ -13,7 +13,7 @@ on:
- cron: '39 3 * * 2'
push:
branches:
- '6.4'
- '7.2'
# Declare default permissions as read only.
permissions: read-all
@ -33,17 +33,17 @@ jobs:
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: "Checkout code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
@ -65,7 +65,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: SARIF file
path: results.sarif
@ -73,6 +73,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/upload-sarif@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
with:
sarif_file: results.sarif

View File

@ -30,9 +30,9 @@ name: SonarCloud analysis
on:
push:
branches: [ "6.4" ]
branches: [ "7.4" ]
pull_request:
branches: [ "6.4" ]
branches: [ "7.4" ]
workflow_dispatch:
permissions:
@ -44,36 +44,18 @@ jobs:
steps:
- name: Block egress traffic
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Analyze with SonarCloud
# You can pin the exact commit or the version.
# uses: SonarSource/sonarcloud-github-action@49e6cd3b187936a73b8280d59ffd9da69df63ec9
uses: SonarSource/sonarcloud-github-action@49e6cd3b187936a73b8280d59ffd9da69df63ec9 # v2.1.1
uses: SonarSource/sonarqube-scan-action@v7.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
with:
# Additional arguments for the sonarcloud scanner
args:
# Unique keys of your project and organization. You can find them in SonarCloud > Information (bottom-left menu)
# mandatory
-Dsonar.projectKey=zabbix_zabbix-docker
-Dsonar.organization=zabbix
# Comma-separated paths to directories containing main source files.
#-Dsonar.sources= # optional, default is project base directory
# When you need the analysis to take place in a directory other than the one from which it was launched
#-Dsonar.projectBaseDir= # optional, default is .
# Comma-separated paths to directories containing test source files.
#-Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/
# Adds more detail to both client and server-side analysis logs, activating DEBUG mode for the scanner, and adding client-side environment variables and system properties to the server-side log of analysis report processing.
#-Dsonar.verbose= # optional, default is false

3
.gitignore vendored
View File

@ -5,3 +5,6 @@ zbx_env*/
.*KEY_FILE
.*CA_FILE
Dockerfiles/*/rhel/secrets/*
sources/*
.*.orig
.*.rej

View File

@ -14,15 +14,17 @@ Zabbix agent is deployed on a monitoring target to actively monitor local resour
# Zabbix agent images
These are the only official Zabbix agent Docker images. They are based on Alpine Linux v3.20, Ubuntu 24.04 (noble), CentOS Stream 9, Oracle Linux 9, Windows 10 LTSC 2019 and Windows 11 LTSC 2022 images. The available versions of Zabbix agent are:
These are the only official Zabbix agent Docker images. They are based on Alpine Linux v3.23, Ubuntu 24.04 (noble), 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 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, ol-5.0-latest, ltsc2019-5.0-latest, ltsc2022-5.0-latest)
Zabbix agent 5.0.* (tags: alpine-5.0.*, ubuntu-5.0.*, ol-5.0.*, ltsc2019-5.0.*, ltsc2022-5.0.*)
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 6.4 (tags: alpine-6.4-latest, ubuntu-6.4-latest, ol-6.4-latest, alpine-latest, ubuntu-latest, ol-latest, ltsc2019-latest, ltsc2022-latest, latest)
Zabbix agent 6.4.* (tags: alpine-6.4.*, ubuntu-6.4.*, ol-6.4.*, ltsc2019-6.4.*, ltsc2022-6.4.*)
Zabbix agent 7.0 (tags: alpine-trunk, ubuntu-trunk, ol-trunk, ltsc2019-trunk, ltsc2022-trunk)
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.
@ -149,13 +151,18 @@ 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
@ -184,7 +191,7 @@ The volume allows load additional modules and extend Zabbix agent using ``LoadMo
### ``/var/lib/zabbix/enc``
The volume is used to store TLS related files. These file names are specified using ``ZBX_TLSCAFILE``, ``ZBX_TLSCRLFILE``, ``ZBX_TLSKEY_FILE`` and ``ZBX_TLSPSKFILE`` variables.
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
@ -218,7 +225,7 @@ Please see [the Docker installation documentation](https://docs.docker.com/insta
## Documentation
Documentation for this image is stored in the [`agent/` directory](https://github.com/zabbix/zabbix-docker/tree/trunk/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/trunk/README.md) before attempting a pull request.
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

View File

@ -1,18 +1,24 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=alpine:3.23
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM alpine:3.20
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}
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" \
@ -28,13 +34,14 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd", "/usr/sbin/zabbix_agentd"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/conf/", "/etc/zabbix/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/conf/", "${ZABBIX_CONF_DIR}/"]
RUN set -eux && \
INSTALL_PKGS="bash \
tzdata \
coreutils \
iputils \
c-ares \
pcre2 \
libgcc \
libcurl \
@ -56,20 +63,35 @@ RUN set -eux && \
--uid 1997 \
--ingroup zabbix \
--shell /sbin/nologin \
--home /var/lib/zabbix/ \
--home ${ZABBIX_USER_HOME_DIR} \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/
mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${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}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${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}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agentd -V
EXPOSE 10050/TCP
WORKDIR /var/lib/zabbix
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -11,15 +11,13 @@ fi
# Default Zabbix installation name
# Default Zabbix server host
: ${ZBX_SERVER_HOST:="zabbix-server"}
ZBX_SERVER_HOST=${ZBX_SERVER_HOST="zabbix-server"}
# Default Zabbix server port number
: ${ZBX_SERVER_PORT:="10051"}
ZBX_SERVER_PORT=${ZBX_SERVER_PORT="10051"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
ZABBIX_INTERNAL_ENC_DIR="${ZABBIX_USER_HOME_DIR}/enc_internal"
escape_spec_char() {
local var_value=$1
@ -57,16 +55,20 @@ update_config_var() {
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value
# Remove configuration parameter definition in case of unset or empty parameter value
if [ -z "$var_value" ]; then
sed -i -e "/^$var_name=/d" "$config_path"
echo "removed"
return
fi
# Remove value from configuration parameter in case of double quoted parameter value
if [ "$var_value" == '""' ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
# Remove value from configuration parameter in case of set to double quoted parameter value
if [[ "$var_value" == '""' ]]; then
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
else
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
fi
echo "undefined"
return
fi
@ -80,7 +82,9 @@ update_config_var() {
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
if [ "$(grep -E "^$var_name=$var_value$" $config_path)" ]; then
echo "exists"
elif [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
echo "updated"
elif [ "$(grep -Ec "^# $var_name=" $config_path)" -gt 1 ]; then
@ -112,99 +116,93 @@ update_config_multiple_var() {
done
}
file_process_from_env() {
local var_name=$1
local file_name=$2
local var_value=$3
if [ ! -z "$var_value" ]; then
echo -n "$var_value" > "${ZABBIX_INTERNAL_ENC_DIR}/$var_name"
file_name="${ZABBIX_INTERNAL_ENC_DIR}/${var_name}"
fi
if [ -n "$var_value" ]; then
export "$var_name"="$file_name"
fi
# Remove variable with plain text data
unset "${var_name%%FILE}"
}
prepare_zbx_agent_config() {
echo "** Preparing Zabbix agent configuration file"
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
: ${ZBX_PASSIVESERVERS=""}
: ${ZBX_ACTIVESERVERS=""}
: ${ZBX_PASSIVESERVERS:=""}
: ${ZBX_ACTIVESERVERS:=""}
if [ ! -z "$ZBX_SERVER_HOST" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST","$ZBX_PASSIVESERVERS
elif [ ! -z "$ZBX_SERVER_HOST" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST
fi
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
update_config_var $ZBX_AGENT_CONFIG "PidFile"
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
update_config_var $ZBX_AGENT_CONFIG "LogFile"
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
if [ ! -z "$ZBX_SERVER_HOST" ]; then
if [ ! -z "$ZBX_SERVER_PORT" ] && [ "$ZBX_SERVER_PORT" != "10051" ]; then
ZBX_SERVER_HOST=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT
fi
if [ ! -z "$ZBX_ACTIVESERVERS" ]; then
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST","$ZBX_ACTIVESERVERS
else
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST
fi
fi
: ${ZBX_PASSIVE_ALLOW:="true"}
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
export ZBX_PASSIVESERVERS="${ZBX_PASSIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "Server"
unset ZBX_PASSIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_AGENT_CONFIG "ListenIP" "${ZBX_LISTENIP}"
update_config_var $ZBX_AGENT_CONFIG "ListenBacklog" "${ZBX_LISTENBACKLOG}"
update_config_var $ZBX_AGENT_CONFIG "StartAgents" "${ZBX_STARTAGENTS}"
: ${ZBX_ACTIVE_ALLOW:="true"}
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_ACTIVESERVERS" ]; then
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
export ZBX_ACTIVESERVERS="${ZBX_ACTIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
unset ZBX_ACTIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "HeartbeatFrequency" "${ZBX_HEARTBEAT_FREQUENCY}"
unset ZBX_SERVER_HOST
unset ZBX_SERVER_PORT
update_config_var $ZBX_AGENT_CONFIG "HostInterface" "${ZBX_HOSTINTERFACE}"
update_config_var $ZBX_AGENT_CONFIG "HostInterfaceItem" "${ZBX_HOSTINTERFACEITEM}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf" "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf" "AllowKey" "${ZBX_ALLOWKEY}"
update_config_var $ZBX_AGENT_CONFIG "Hostname" "${ZBX_HOSTNAME}"
update_config_var $ZBX_AGENT_CONFIG "HostnameItem" "${ZBX_HOSTNAMEITEM}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadata" "${ZBX_METADATA}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadataItem" "${ZBX_METADATAITEM}"
update_config_var $ZBX_AGENT_CONFIG "RefreshActiveChecks" "${ZBX_REFRESHACTIVECHECKS}"
update_config_var $ZBX_AGENT_CONFIG "BufferSend" "${ZBX_BUFFERSEND}"
update_config_var $ZBX_AGENT_CONFIG "BufferSize" "${ZBX_BUFFERSIZE}"
update_config_var $ZBX_AGENT_CONFIG "MaxLinesPerSecond" "${ZBX_MAXLINESPERSECOND}"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/"
update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCRLFile" "${ZBX_TLSCRLFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherAll" "${ZBX_TLSCIPHERALL}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherAll13" "${ZBX_TLSCIPHERALL13}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherCert" "${ZBX_TLSCIPHERCERT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherCert13" "${ZBX_TLSCIPHERCERT13}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherPSK" "${ZBX_TLSCIPHERPSK}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherPSK13" "${ZBX_TLSCIPHERPSK13}"
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf" "LoadModule" "${ZBX_LOADMODULE}"
update_config_multiple_var $ZBX_AGENT_CONFIG "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var $ZBX_AGENT_CONFIG "AllowKey" "${ZBX_ALLOWKEY}"
file_process_from_env "ZBX_TLSCAFILE" "${ZBX_TLSCAFILE}" "${ZBX_TLSCA}"
file_process_from_env "ZBX_TLSCRLFILE" "${ZBX_TLSCRLFILE}" "${ZBX_TLSCRL}"
file_process_from_env "ZBX_TLSCERTFILE" "${ZBX_TLSCERTFILE}" "${ZBX_TLSCERT}"
file_process_from_env "ZBX_TLSKEYFILE" "${ZBX_TLSKEYFILE}" "${ZBX_TLSKEY}"
file_process_from_env "ZBX_TLSPSKFILE" "${ZBX_TLSPSKFILE}" "${ZBX_TLSPSK}"
if [ "$(id -u)" != '0' ]; then
update_config_var $ZBX_AGENT_CONFIG "User" "$(whoami)"
export ZBX_USER="$(whoami)"
else
update_config_var $ZBX_AGENT_CONFIG "AllowRoot" "1"
export ZBX_ALLOWROOT=1
fi
}
clear_zbx_env() {
[[ "${ZBX_CLEAR_ENV}" == "false" ]] && return
for env_var in $(env | grep -E "^ZABBIX_"); do
unset "${env_var%%=*}"
done
}
prepare_agent() {
echo "** Preparing Zabbix agent"
prepare_zbx_agent_config
clear_zbx_env
}
#################################################

View File

@ -1,18 +1,24 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=quay.io/centos/centos:stream10-minimal
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM quay.io/centos/centos:stream9-minimal
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}
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" \
@ -28,16 +34,19 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd", "/usr/sbin/zabbix_agentd"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/conf/", "/etc/zabbix/"]
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 \
iputils \
c-ares \
pcre2 \
libcurl-minimal \
libmodbus \
# libmodbus \
openssl-libs \
openldap \
shadow-utils \
zlib" && \
microdnf -y install \
@ -68,25 +77,40 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--gid 1995 \
zabbix && \
useradd \
--system --comment "Zabbix monitoring system" \
--system \
--comment "Zabbix monitoring system" \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \
microdnf -y clean all
mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${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}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${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}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agentd -V
EXPOSE 10050/TCP
WORKDIR /var/lib/zabbix
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -11,15 +11,13 @@ fi
# Default Zabbix installation name
# Default Zabbix server host
: ${ZBX_SERVER_HOST:="zabbix-server"}
ZBX_SERVER_HOST=${ZBX_SERVER_HOST="zabbix-server"}
# Default Zabbix server port number
: ${ZBX_SERVER_PORT:="10051"}
ZBX_SERVER_PORT=${ZBX_SERVER_PORT="10051"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
ZABBIX_INTERNAL_ENC_DIR="${ZABBIX_USER_HOME_DIR}/enc_internal"
escape_spec_char() {
local var_value=$1
@ -57,16 +55,20 @@ update_config_var() {
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value
# Remove configuration parameter definition in case of unset or empty parameter value
if [ -z "$var_value" ]; then
sed -i -e "/^$var_name=/d" "$config_path"
echo "removed"
return
fi
# Remove value from configuration parameter in case of double quoted parameter value
if [ "$var_value" == '""' ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
# Remove value from configuration parameter in case of set to double quoted parameter value
if [[ "$var_value" == '""' ]]; then
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
else
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
fi
echo "undefined"
return
fi
@ -80,7 +82,9 @@ update_config_var() {
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
if [ "$(grep -E "^$var_name=$var_value$" $config_path)" ]; then
echo "exists"
elif [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
echo "updated"
elif [ "$(grep -Ec "^# $var_name=" $config_path)" -gt 1 ]; then
@ -112,99 +116,93 @@ update_config_multiple_var() {
done
}
file_process_from_env() {
local var_name=$1
local file_name=$2
local var_value=$3
if [ ! -z "$var_value" ]; then
echo -n "$var_value" > "${ZABBIX_INTERNAL_ENC_DIR}/$var_name"
file_name="${ZABBIX_INTERNAL_ENC_DIR}/${var_name}"
fi
if [ -n "$var_value" ]; then
export "$var_name"="$file_name"
fi
# Remove variable with plain text data
unset "${var_name%%FILE}"
}
prepare_zbx_agent_config() {
echo "** Preparing Zabbix agent configuration file"
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
: ${ZBX_PASSIVESERVERS=""}
: ${ZBX_ACTIVESERVERS=""}
: ${ZBX_PASSIVESERVERS:=""}
: ${ZBX_ACTIVESERVERS:=""}
if [ ! -z "$ZBX_SERVER_HOST" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST","$ZBX_PASSIVESERVERS
elif [ ! -z "$ZBX_SERVER_HOST" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST
fi
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
update_config_var $ZBX_AGENT_CONFIG "PidFile"
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
update_config_var $ZBX_AGENT_CONFIG "LogFile"
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
if [ ! -z "$ZBX_SERVER_HOST" ]; then
if [ ! -z "$ZBX_SERVER_PORT" ] && [ "$ZBX_SERVER_PORT" != "10051" ]; then
ZBX_SERVER_HOST=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT
fi
if [ ! -z "$ZBX_ACTIVESERVERS" ]; then
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST","$ZBX_ACTIVESERVERS
else
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST
fi
fi
: ${ZBX_PASSIVE_ALLOW:="true"}
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
export ZBX_PASSIVESERVERS="${ZBX_PASSIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "Server"
unset ZBX_PASSIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_AGENT_CONFIG "ListenIP" "${ZBX_LISTENIP}"
update_config_var $ZBX_AGENT_CONFIG "ListenBacklog" "${ZBX_LISTENBACKLOG}"
update_config_var $ZBX_AGENT_CONFIG "StartAgents" "${ZBX_STARTAGENTS}"
: ${ZBX_ACTIVE_ALLOW:="true"}
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_ACTIVESERVERS" ]; then
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
export ZBX_ACTIVESERVERS="${ZBX_ACTIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
unset ZBX_ACTIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "HeartbeatFrequency" "${ZBX_HEARTBEAT_FREQUENCY}"
unset ZBX_SERVER_HOST
unset ZBX_SERVER_PORT
update_config_var $ZBX_AGENT_CONFIG "HostInterface" "${ZBX_HOSTINTERFACE}"
update_config_var $ZBX_AGENT_CONFIG "HostInterfaceItem" "${ZBX_HOSTINTERFACEITEM}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf" "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf" "AllowKey" "${ZBX_ALLOWKEY}"
update_config_var $ZBX_AGENT_CONFIG "Hostname" "${ZBX_HOSTNAME}"
update_config_var $ZBX_AGENT_CONFIG "HostnameItem" "${ZBX_HOSTNAMEITEM}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadata" "${ZBX_METADATA}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadataItem" "${ZBX_METADATAITEM}"
update_config_var $ZBX_AGENT_CONFIG "RefreshActiveChecks" "${ZBX_REFRESHACTIVECHECKS}"
update_config_var $ZBX_AGENT_CONFIG "BufferSend" "${ZBX_BUFFERSEND}"
update_config_var $ZBX_AGENT_CONFIG "BufferSize" "${ZBX_BUFFERSIZE}"
update_config_var $ZBX_AGENT_CONFIG "MaxLinesPerSecond" "${ZBX_MAXLINESPERSECOND}"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/"
update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCRLFile" "${ZBX_TLSCRLFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherAll" "${ZBX_TLSCIPHERALL}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherAll13" "${ZBX_TLSCIPHERALL13}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherCert" "${ZBX_TLSCIPHERCERT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherCert13" "${ZBX_TLSCIPHERCERT13}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherPSK" "${ZBX_TLSCIPHERPSK}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherPSK13" "${ZBX_TLSCIPHERPSK13}"
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf" "LoadModule" "${ZBX_LOADMODULE}"
update_config_multiple_var $ZBX_AGENT_CONFIG "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var $ZBX_AGENT_CONFIG "AllowKey" "${ZBX_ALLOWKEY}"
file_process_from_env "ZBX_TLSCAFILE" "${ZBX_TLSCAFILE}" "${ZBX_TLSCA}"
file_process_from_env "ZBX_TLSCRLFILE" "${ZBX_TLSCRLFILE}" "${ZBX_TLSCRL}"
file_process_from_env "ZBX_TLSCERTFILE" "${ZBX_TLSCERTFILE}" "${ZBX_TLSCERT}"
file_process_from_env "ZBX_TLSKEYFILE" "${ZBX_TLSKEYFILE}" "${ZBX_TLSKEY}"
file_process_from_env "ZBX_TLSPSKFILE" "${ZBX_TLSPSKFILE}" "${ZBX_TLSPSK}"
if [ "$(id -u)" != '0' ]; then
update_config_var $ZBX_AGENT_CONFIG "User" "$(whoami)"
export ZBX_USER="$(whoami)"
else
update_config_var $ZBX_AGENT_CONFIG "AllowRoot" "1"
export ZBX_ALLOWROOT=1
fi
}
clear_zbx_env() {
[[ "${ZBX_CLEAR_ENV}" == "false" ]] && return
for env_var in $(env | grep -E "^ZABBIX_"); do
unset "${env_var%%=*}"
done
}
prepare_agent() {
echo "** Preparing Zabbix agent"
prepare_zbx_agent_config
clear_zbx_env
}
#################################################

View File

@ -1,18 +1,24 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM oraclelinux:9-slim
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}
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" \
@ -28,23 +34,25 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd", "/usr/sbin/zabbix_agentd"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/conf/", "/etc/zabbix/"]
COPY ["conf/etc/yum.repos.d/oracle-epel-ol9.repo", "/etc/yum.repos.d/oracle-epel-ol9.repo"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/conf/", "${ZABBIX_CONF_DIR}/"]
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
iputils \
c-ares \
pcre2 \
libcurl \
libmodbus \
# libmodbus \
openssl-libs \
zlib" && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ol9_baseos_latest" \
--enablerepo="ol9_appstream" \
--enablerepo="ol9_developer_EPEL" \
--enablerepo="ol10_baseos_latest" \
--enablerepo="ol10_appstream" \
--enablerepo="ol10_u0_developer_EPEL" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
@ -60,21 +68,35 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \
microdnf -y clean all
mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${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}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${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}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agentd -V
EXPOSE 10050/TCP
WORKDIR /var/lib/zabbix
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -0,0 +1,6 @@
[ol10_u0_developer_EPEL]
name=Oracle Linux $releasever.0 EPEL Packages for Development ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL10/0/developer/EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

View File

@ -1,6 +0,0 @@
[ol9_developer_EPEL]
name=Oracle Linux $releasever EPEL Packages for Development ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL9/developer/EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

View File

@ -11,15 +11,13 @@ fi
# Default Zabbix installation name
# Default Zabbix server host
: ${ZBX_SERVER_HOST:="zabbix-server"}
ZBX_SERVER_HOST=${ZBX_SERVER_HOST="zabbix-server"}
# Default Zabbix server port number
: ${ZBX_SERVER_PORT:="10051"}
ZBX_SERVER_PORT=${ZBX_SERVER_PORT="10051"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
ZABBIX_INTERNAL_ENC_DIR="${ZABBIX_USER_HOME_DIR}/enc_internal"
escape_spec_char() {
local var_value=$1
@ -57,16 +55,20 @@ update_config_var() {
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value
# Remove configuration parameter definition in case of unset or empty parameter value
if [ -z "$var_value" ]; then
sed -i -e "/^$var_name=/d" "$config_path"
echo "removed"
return
fi
# Remove value from configuration parameter in case of double quoted parameter value
if [ "$var_value" == '""' ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
# Remove value from configuration parameter in case of set to double quoted parameter value
if [[ "$var_value" == '""' ]]; then
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
else
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
fi
echo "undefined"
return
fi
@ -80,7 +82,9 @@ update_config_var() {
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
if [ "$(grep -E "^$var_name=$var_value$" $config_path)" ]; then
echo "exists"
elif [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
echo "updated"
elif [ "$(grep -Ec "^# $var_name=" $config_path)" -gt 1 ]; then
@ -112,99 +116,93 @@ update_config_multiple_var() {
done
}
file_process_from_env() {
local var_name=$1
local file_name=$2
local var_value=$3
if [ ! -z "$var_value" ]; then
echo -n "$var_value" > "${ZABBIX_INTERNAL_ENC_DIR}/$var_name"
file_name="${ZABBIX_INTERNAL_ENC_DIR}/${var_name}"
fi
if [ -n "$var_value" ]; then
export "$var_name"="$file_name"
fi
# Remove variable with plain text data
unset "${var_name%%FILE}"
}
prepare_zbx_agent_config() {
echo "** Preparing Zabbix agent configuration file"
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
: ${ZBX_PASSIVESERVERS=""}
: ${ZBX_ACTIVESERVERS=""}
: ${ZBX_PASSIVESERVERS:=""}
: ${ZBX_ACTIVESERVERS:=""}
if [ ! -z "$ZBX_SERVER_HOST" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST","$ZBX_PASSIVESERVERS
elif [ ! -z "$ZBX_SERVER_HOST" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST
fi
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
update_config_var $ZBX_AGENT_CONFIG "PidFile"
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
update_config_var $ZBX_AGENT_CONFIG "LogFile"
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
if [ ! -z "$ZBX_SERVER_HOST" ]; then
if [ ! -z "$ZBX_SERVER_PORT" ] && [ "$ZBX_SERVER_PORT" != "10051" ]; then
ZBX_SERVER_HOST=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT
fi
if [ ! -z "$ZBX_ACTIVESERVERS" ]; then
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST","$ZBX_ACTIVESERVERS
else
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST
fi
fi
: ${ZBX_PASSIVE_ALLOW:="true"}
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
export ZBX_PASSIVESERVERS="${ZBX_PASSIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "Server"
unset ZBX_PASSIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_AGENT_CONFIG "ListenIP" "${ZBX_LISTENIP}"
update_config_var $ZBX_AGENT_CONFIG "ListenBacklog" "${ZBX_LISTENBACKLOG}"
update_config_var $ZBX_AGENT_CONFIG "StartAgents" "${ZBX_STARTAGENTS}"
: ${ZBX_ACTIVE_ALLOW:="true"}
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_ACTIVESERVERS" ]; then
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
export ZBX_ACTIVESERVERS="${ZBX_ACTIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
unset ZBX_ACTIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "HeartbeatFrequency" "${ZBX_HEARTBEAT_FREQUENCY}"
unset ZBX_SERVER_HOST
unset ZBX_SERVER_PORT
update_config_var $ZBX_AGENT_CONFIG "HostInterface" "${ZBX_HOSTINTERFACE}"
update_config_var $ZBX_AGENT_CONFIG "HostInterfaceItem" "${ZBX_HOSTINTERFACEITEM}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf" "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf" "AllowKey" "${ZBX_ALLOWKEY}"
update_config_var $ZBX_AGENT_CONFIG "Hostname" "${ZBX_HOSTNAME}"
update_config_var $ZBX_AGENT_CONFIG "HostnameItem" "${ZBX_HOSTNAMEITEM}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadata" "${ZBX_METADATA}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadataItem" "${ZBX_METADATAITEM}"
update_config_var $ZBX_AGENT_CONFIG "RefreshActiveChecks" "${ZBX_REFRESHACTIVECHECKS}"
update_config_var $ZBX_AGENT_CONFIG "BufferSend" "${ZBX_BUFFERSEND}"
update_config_var $ZBX_AGENT_CONFIG "BufferSize" "${ZBX_BUFFERSIZE}"
update_config_var $ZBX_AGENT_CONFIG "MaxLinesPerSecond" "${ZBX_MAXLINESPERSECOND}"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/"
update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCRLFile" "${ZBX_TLSCRLFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherAll" "${ZBX_TLSCIPHERALL}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherAll13" "${ZBX_TLSCIPHERALL13}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherCert" "${ZBX_TLSCIPHERCERT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherCert13" "${ZBX_TLSCIPHERCERT13}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherPSK" "${ZBX_TLSCIPHERPSK}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherPSK13" "${ZBX_TLSCIPHERPSK13}"
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf" "LoadModule" "${ZBX_LOADMODULE}"
update_config_multiple_var $ZBX_AGENT_CONFIG "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var $ZBX_AGENT_CONFIG "AllowKey" "${ZBX_ALLOWKEY}"
file_process_from_env "ZBX_TLSCAFILE" "${ZBX_TLSCAFILE}" "${ZBX_TLSCA}"
file_process_from_env "ZBX_TLSCRLFILE" "${ZBX_TLSCRLFILE}" "${ZBX_TLSCRL}"
file_process_from_env "ZBX_TLSCERTFILE" "${ZBX_TLSCERTFILE}" "${ZBX_TLSCERT}"
file_process_from_env "ZBX_TLSKEYFILE" "${ZBX_TLSKEYFILE}" "${ZBX_TLSKEY}"
file_process_from_env "ZBX_TLSPSKFILE" "${ZBX_TLSPSKFILE}" "${ZBX_TLSPSK}"
if [ "$(id -u)" != '0' ]; then
update_config_var $ZBX_AGENT_CONFIG "User" "$(whoami)"
export ZBX_USER="$(whoami)"
else
update_config_var $ZBX_AGENT_CONFIG "AllowRoot" "1"
export ZBX_ALLOWROOT=1
fi
}
clear_zbx_env() {
[[ "${ZBX_CLEAR_ENV}" == "false" ]] && return
for env_var in $(env | grep -E "^ZABBIX_"); do
unset "${env_var%%=*}"
done
}
prepare_agent() {
echo "** Preparing Zabbix agent"
prepare_zbx_agent_config
clear_zbx_env
}
#################################################

View File

@ -1,12 +1,13 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG RELEASE=0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=registry.access.redhat.com/ubi10/ubi-minimal:10.1
ARG MAJOR_VERSION=7.4
ARG RELEASE=6
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG RELEASE
@ -14,13 +15,18 @@ 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}
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-trunk" \
name="zabbix/zabbix-agent-74" \
release="${RELEASE}" \
run="podman run --name zabbix-agent -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent-trunk:${ZBX_VERSION}" \
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" \
@ -31,7 +37,7 @@ LABEL description="Zabbix agent is deployed on a monitoring target to actively m
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-trunk:${ZBX_VERSION}" \
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" \
@ -47,24 +53,28 @@ STOPSIGNAL SIGTERM
COPY ["licenses", "/licenses"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd", "/usr/sbin/zabbix_agentd"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/conf/", "/etc/zabbix/"]
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 \
iputils \
shadow-utils \
c-ares \
pcre2 \
libmodbus \
# libmodbus \
libcurl-minimal \
openldap \
zlib" && \
curl --tlsv1.2 -sSf -L https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -o /tmp/epel-release-latest-9.noarch.rpm && \
rpm -ivh /tmp/epel-release-latest-9.noarch.rpm && \
rm -rf /tmp/epel-release-latest-9.noarch.rpm && \
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 \
--disableplugin=subscription-manager \
--disablerepo "*" \
--enablerepo "ubi-9-baseos-rpms" \
--enablerepo "ubi-10-baseos-rpms" \
--enablerepo "rhel-10-for-$ARCH_SUFFIX-baseos-rpms" \
--enablerepo "epel" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
@ -74,20 +84,20 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
microdnf -y update \
--disableplugin=subscription-manager \
--disablerepo "*" \
--enablerepo "ubi-9-baseos-rpms" \
--enablerepo "ubi-10-baseos-rpms" \
--setopt=install_weak_deps=0 \
--best \
--setopt=tsflags=nodocs \
tzdata && \
microdnf -y reinstall \
--disableplugin=subscription-manager \
--disablerepo "*" \
--enablerepo "ubi-9-baseos-rpms" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--setopt=tsflags=nodocs \
tzdata && \
# microdnf -y reinstall \
# --disableplugin=subscription-manager \
# --disablerepo "*" \
# --enablerepo "ubi-10-baseos-rpms" \
# --setopt=install_weak_deps=0 \
# --setopt=keepcache=0 \
# --best \
# --setopt=tsflags=nodocs \
# tzdata && \
groupadd \
--system \
--gid 1995 \
@ -98,21 +108,35 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \
microdnf -y clean all
mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${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}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${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}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agentd -V
EXPOSE 10050/TCP
WORKDIR /var/lib/zabbix
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -111,7 +111,7 @@
<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_TLSKEY_FILE</code> and <code>ZBX_TLSPSKFILE</code> variables.</p>
<h1 id="user-feedback">User Feedback</h1>
<h2 id="documentation">Documentation</h2>
<p>Documentation for this image is stored in the <a href="https://github.com/zabbix/zabbix-docker/tree/trunk/Dockerfiles/agent"><code>agent/</code> directory</a> of the <a href="https://github.com/zabbix/zabbix-docker/"><code>zabbix/zabbix-docker</code> GitHub repo</a>. Be sure to familiarize yourself with the <a href="https://github.com/zabbix/zabbix-docker/blob/trunk/README.md">repository&#39;s <code>README.md</code> file</a> before attempting a pull request.</p>
<p>Documentation for this image is stored in the <a href="https://github.com/zabbix/zabbix-docker/tree/7.4/Dockerfiles/agent"><code>agent/</code> directory</a> of the <a href="https://github.com/zabbix/zabbix-docker/"><code>zabbix/zabbix-docker</code> GitHub repo</a>. Be sure to familiarize yourself with the <a href="https://github.com/zabbix/zabbix-docker/blob/7.4/README.md">repository&#39;s <code>README.md</code> file</a> before attempting a pull request.</p>
<h2 id="issues">Issues</h2>
<p>If you have any problems with or questions about this image, please contact us through a <a href="https://github.com/zabbix/zabbix-docker/issues">GitHub issue</a>.</p>
<h3 id="known-issues">Known issues</h3>

View File

@ -11,15 +11,13 @@ fi
# Default Zabbix installation name
# Default Zabbix server host
: ${ZBX_SERVER_HOST:="zabbix-server"}
ZBX_SERVER_HOST=${ZBX_SERVER_HOST="zabbix-server"}
# Default Zabbix server port number
: ${ZBX_SERVER_PORT:="10051"}
ZBX_SERVER_PORT=${ZBX_SERVER_PORT="10051"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
ZABBIX_INTERNAL_ENC_DIR="${ZABBIX_USER_HOME_DIR}/enc_internal"
escape_spec_char() {
local var_value=$1
@ -57,16 +55,20 @@ update_config_var() {
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value
# Remove configuration parameter definition in case of unset or empty parameter value
if [ -z "$var_value" ]; then
sed -i -e "/^$var_name=/d" "$config_path"
echo "removed"
return
fi
# Remove value from configuration parameter in case of double quoted parameter value
if [ "$var_value" == '""' ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
# Remove value from configuration parameter in case of set to double quoted parameter value
if [[ "$var_value" == '""' ]]; then
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
else
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
fi
echo "undefined"
return
fi
@ -80,7 +82,9 @@ update_config_var() {
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
if [ "$(grep -E "^$var_name=$var_value$" $config_path)" ]; then
echo "exists"
elif [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
echo "updated"
elif [ "$(grep -Ec "^# $var_name=" $config_path)" -gt 1 ]; then
@ -112,99 +116,93 @@ update_config_multiple_var() {
done
}
file_process_from_env() {
local var_name=$1
local file_name=$2
local var_value=$3
if [ ! -z "$var_value" ]; then
echo -n "$var_value" > "${ZABBIX_INTERNAL_ENC_DIR}/$var_name"
file_name="${ZABBIX_INTERNAL_ENC_DIR}/${var_name}"
fi
if [ -n "$var_value" ]; then
export "$var_name"="$file_name"
fi
# Remove variable with plain text data
unset "${var_name%%FILE}"
}
prepare_zbx_agent_config() {
echo "** Preparing Zabbix agent configuration file"
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
: ${ZBX_PASSIVESERVERS=""}
: ${ZBX_ACTIVESERVERS=""}
: ${ZBX_PASSIVESERVERS:=""}
: ${ZBX_ACTIVESERVERS:=""}
if [ ! -z "$ZBX_SERVER_HOST" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST","$ZBX_PASSIVESERVERS
elif [ ! -z "$ZBX_SERVER_HOST" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST
fi
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
update_config_var $ZBX_AGENT_CONFIG "PidFile"
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
update_config_var $ZBX_AGENT_CONFIG "LogFile"
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
if [ ! -z "$ZBX_SERVER_HOST" ]; then
if [ ! -z "$ZBX_SERVER_PORT" ] && [ "$ZBX_SERVER_PORT" != "10051" ]; then
ZBX_SERVER_HOST=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT
fi
if [ ! -z "$ZBX_ACTIVESERVERS" ]; then
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST","$ZBX_ACTIVESERVERS
else
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST
fi
fi
: ${ZBX_PASSIVE_ALLOW:="true"}
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
export ZBX_PASSIVESERVERS="${ZBX_PASSIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "Server"
unset ZBX_PASSIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_AGENT_CONFIG "ListenIP" "${ZBX_LISTENIP}"
update_config_var $ZBX_AGENT_CONFIG "ListenBacklog" "${ZBX_LISTENBACKLOG}"
update_config_var $ZBX_AGENT_CONFIG "StartAgents" "${ZBX_STARTAGENTS}"
: ${ZBX_ACTIVE_ALLOW:="true"}
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_ACTIVESERVERS" ]; then
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
export ZBX_ACTIVESERVERS="${ZBX_ACTIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
unset ZBX_ACTIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "HeartbeatFrequency" "${ZBX_HEARTBEAT_FREQUENCY}"
unset ZBX_SERVER_HOST
unset ZBX_SERVER_PORT
update_config_var $ZBX_AGENT_CONFIG "HostInterface" "${ZBX_HOSTINTERFACE}"
update_config_var $ZBX_AGENT_CONFIG "HostInterfaceItem" "${ZBX_HOSTINTERFACEITEM}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf" "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf" "AllowKey" "${ZBX_ALLOWKEY}"
update_config_var $ZBX_AGENT_CONFIG "Hostname" "${ZBX_HOSTNAME}"
update_config_var $ZBX_AGENT_CONFIG "HostnameItem" "${ZBX_HOSTNAMEITEM}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadata" "${ZBX_METADATA}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadataItem" "${ZBX_METADATAITEM}"
update_config_var $ZBX_AGENT_CONFIG "RefreshActiveChecks" "${ZBX_REFRESHACTIVECHECKS}"
update_config_var $ZBX_AGENT_CONFIG "BufferSend" "${ZBX_BUFFERSEND}"
update_config_var $ZBX_AGENT_CONFIG "BufferSize" "${ZBX_BUFFERSIZE}"
update_config_var $ZBX_AGENT_CONFIG "MaxLinesPerSecond" "${ZBX_MAXLINESPERSECOND}"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/"
update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCRLFile" "${ZBX_TLSCRLFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherAll" "${ZBX_TLSCIPHERALL}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherAll13" "${ZBX_TLSCIPHERALL13}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherCert" "${ZBX_TLSCIPHERCERT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherCert13" "${ZBX_TLSCIPHERCERT13}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherPSK" "${ZBX_TLSCIPHERPSK}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherPSK13" "${ZBX_TLSCIPHERPSK13}"
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf" "LoadModule" "${ZBX_LOADMODULE}"
update_config_multiple_var $ZBX_AGENT_CONFIG "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var $ZBX_AGENT_CONFIG "AllowKey" "${ZBX_ALLOWKEY}"
file_process_from_env "ZBX_TLSCAFILE" "${ZBX_TLSCAFILE}" "${ZBX_TLSCA}"
file_process_from_env "ZBX_TLSCRLFILE" "${ZBX_TLSCRLFILE}" "${ZBX_TLSCRL}"
file_process_from_env "ZBX_TLSCERTFILE" "${ZBX_TLSCERTFILE}" "${ZBX_TLSCERT}"
file_process_from_env "ZBX_TLSKEYFILE" "${ZBX_TLSKEYFILE}" "${ZBX_TLSKEY}"
file_process_from_env "ZBX_TLSPSKFILE" "${ZBX_TLSPSKFILE}" "${ZBX_TLSPSK}"
if [ "$(id -u)" != '0' ]; then
update_config_var $ZBX_AGENT_CONFIG "User" "$(whoami)"
export ZBX_USER="$(whoami)"
else
update_config_var $ZBX_AGENT_CONFIG "AllowRoot" "1"
export ZBX_ALLOWROOT=1
fi
}
clear_zbx_env() {
[[ "${ZBX_CLEAR_ENV}" == "false" ]] && return
for env_var in $(env | grep -E "^ZABBIX_"); do
unset "${env_var%%=*}"
done
}
prepare_agent() {
echo "** Preparing Zabbix agent"
prepare_zbx_agent_config
clear_zbx_env
}
#################################################

View File

@ -1,18 +1,24 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=ubuntu:noble
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ubuntu:noble
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}
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" \
@ -28,14 +34,17 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/sbin/zabbix_agentd", "/usr/sbin/zabbix_agentd"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/conf/", "/etc/zabbix/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent/conf/", "${ZABBIX_CONF_DIR}/"]
RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--mount=type=cache,target=/var/lib/apt/,sharing=locked \
set -eux && \
echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \
INSTALL_PKGS="bash \
tzdata \
iputils-ping \
ca-certificates \
libcares2 \
libssl3t64 \
libcurl4t64 \
libmodbus5 \
@ -56,22 +65,35 @@ RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \
apt-get -y autoremove && \
apt-get -y clean
mkdir -p ${ZABBIX_CONF_DIR}/ && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/modules && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${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}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${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}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agentd -V
EXPOSE 10050/TCP
WORKDIR /var/lib/zabbix
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -11,15 +11,13 @@ fi
# Default Zabbix installation name
# Default Zabbix server host
: ${ZBX_SERVER_HOST:="zabbix-server"}
ZBX_SERVER_HOST=${ZBX_SERVER_HOST="zabbix-server"}
# Default Zabbix server port number
: ${ZBX_SERVER_PORT:="10051"}
ZBX_SERVER_PORT=${ZBX_SERVER_PORT="10051"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
ZABBIX_INTERNAL_ENC_DIR="${ZABBIX_USER_HOME_DIR}/enc_internal"
escape_spec_char() {
local var_value=$1
@ -57,16 +55,20 @@ update_config_var() {
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value
# Remove configuration parameter definition in case of unset or empty parameter value
if [ -z "$var_value" ]; then
sed -i -e "/^$var_name=/d" "$config_path"
echo "removed"
return
fi
# Remove value from configuration parameter in case of double quoted parameter value
if [ "$var_value" == '""' ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
# Remove value from configuration parameter in case of set to double quoted parameter value
if [[ "$var_value" == '""' ]]; then
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
else
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
fi
echo "undefined"
return
fi
@ -80,7 +82,9 @@ update_config_var() {
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
if [ "$(grep -E "^$var_name=$var_value$" $config_path)" ]; then
echo "exists"
elif [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
echo "updated"
elif [ "$(grep -Ec "^# $var_name=" $config_path)" -gt 1 ]; then
@ -112,99 +116,93 @@ update_config_multiple_var() {
done
}
file_process_from_env() {
local var_name=$1
local file_name=$2
local var_value=$3
if [ ! -z "$var_value" ]; then
echo -n "$var_value" > "${ZABBIX_INTERNAL_ENC_DIR}/$var_name"
file_name="${ZABBIX_INTERNAL_ENC_DIR}/${var_name}"
fi
if [ -n "$var_value" ]; then
export "$var_name"="$file_name"
fi
# Remove variable with plain text data
unset "${var_name%%FILE}"
}
prepare_zbx_agent_config() {
echo "** Preparing Zabbix agent configuration file"
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agentd.conf
: ${ZBX_PASSIVESERVERS=""}
: ${ZBX_ACTIVESERVERS=""}
: ${ZBX_PASSIVESERVERS:=""}
: ${ZBX_ACTIVESERVERS:=""}
if [ ! -z "$ZBX_SERVER_HOST" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST","$ZBX_PASSIVESERVERS
elif [ ! -z "$ZBX_SERVER_HOST" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST
fi
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
update_config_var $ZBX_AGENT_CONFIG "PidFile"
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
update_config_var $ZBX_AGENT_CONFIG "LogFile"
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
update_config_var $ZBX_AGENT_CONFIG "LogRemoteCommands" "${ZBX_LOGREMOTECOMMANDS}"
if [ ! -z "$ZBX_SERVER_HOST" ]; then
if [ ! -z "$ZBX_SERVER_PORT" ] && [ "$ZBX_SERVER_PORT" != "10051" ]; then
ZBX_SERVER_HOST=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT
fi
if [ ! -z "$ZBX_ACTIVESERVERS" ]; then
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST","$ZBX_ACTIVESERVERS
else
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST
fi
fi
: ${ZBX_PASSIVE_ALLOW:="true"}
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
export ZBX_PASSIVESERVERS="${ZBX_PASSIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "Server"
unset ZBX_PASSIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_AGENT_CONFIG "ListenIP" "${ZBX_LISTENIP}"
update_config_var $ZBX_AGENT_CONFIG "ListenBacklog" "${ZBX_LISTENBACKLOG}"
update_config_var $ZBX_AGENT_CONFIG "StartAgents" "${ZBX_STARTAGENTS}"
: ${ZBX_ACTIVE_ALLOW:="true"}
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_ACTIVESERVERS" ]; then
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
export ZBX_ACTIVESERVERS="${ZBX_ACTIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
unset ZBX_ACTIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "HeartbeatFrequency" "${ZBX_HEARTBEAT_FREQUENCY}"
unset ZBX_SERVER_HOST
unset ZBX_SERVER_PORT
update_config_var $ZBX_AGENT_CONFIG "HostInterface" "${ZBX_HOSTINTERFACE}"
update_config_var $ZBX_AGENT_CONFIG "HostInterfaceItem" "${ZBX_HOSTINTERFACEITEM}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf" "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_item_keys.conf" "AllowKey" "${ZBX_ALLOWKEY}"
update_config_var $ZBX_AGENT_CONFIG "Hostname" "${ZBX_HOSTNAME}"
update_config_var $ZBX_AGENT_CONFIG "HostnameItem" "${ZBX_HOSTNAMEITEM}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadata" "${ZBX_METADATA}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadataItem" "${ZBX_METADATAITEM}"
update_config_var $ZBX_AGENT_CONFIG "RefreshActiveChecks" "${ZBX_REFRESHACTIVECHECKS}"
update_config_var $ZBX_AGENT_CONFIG "BufferSend" "${ZBX_BUFFERSEND}"
update_config_var $ZBX_AGENT_CONFIG "BufferSize" "${ZBX_BUFFERSIZE}"
update_config_var $ZBX_AGENT_CONFIG "MaxLinesPerSecond" "${ZBX_MAXLINESPERSECOND}"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/"
update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCRLFile" "${ZBX_TLSCRLFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherAll" "${ZBX_TLSCIPHERALL}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherAll13" "${ZBX_TLSCIPHERALL13}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherCert" "${ZBX_TLSCIPHERCERT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherCert13" "${ZBX_TLSCIPHERCERT13}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherPSK" "${ZBX_TLSCIPHERPSK}"
update_config_var $ZBX_AGENT_CONFIG "TLSCipherPSK13" "${ZBX_TLSCIPHERPSK13}"
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agentd_modules.conf" "LoadModule" "${ZBX_LOADMODULE}"
update_config_multiple_var $ZBX_AGENT_CONFIG "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var $ZBX_AGENT_CONFIG "AllowKey" "${ZBX_ALLOWKEY}"
file_process_from_env "ZBX_TLSCAFILE" "${ZBX_TLSCAFILE}" "${ZBX_TLSCA}"
file_process_from_env "ZBX_TLSCRLFILE" "${ZBX_TLSCRLFILE}" "${ZBX_TLSCRL}"
file_process_from_env "ZBX_TLSCERTFILE" "${ZBX_TLSCERTFILE}" "${ZBX_TLSCERT}"
file_process_from_env "ZBX_TLSKEYFILE" "${ZBX_TLSKEYFILE}" "${ZBX_TLSKEY}"
file_process_from_env "ZBX_TLSPSKFILE" "${ZBX_TLSPSKFILE}" "${ZBX_TLSPSK}"
if [ "$(id -u)" != '0' ]; then
update_config_var $ZBX_AGENT_CONFIG "User" "$(whoami)"
export ZBX_USER="$(whoami)"
else
update_config_var $ZBX_AGENT_CONFIG "AllowRoot" "1"
export ZBX_ALLOWROOT=1
fi
}
clear_zbx_env() {
[[ "${ZBX_CLEAR_ENV}" == "false" ]] && return
for env_var in $(env | grep -E "^ZABBIX_"); do
unset "${env_var%%=*}"
done
}
prepare_agent() {
echo "** Preparing Zabbix agent"
prepare_zbx_agent_config
clear_zbx_env
}
#################################################

View File

@ -1,19 +1,24 @@
# syntax=docker/dockerfile:1
# escape=`
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:ltsc2022
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent-${ZBX_VERSION}
ARG BASE_IMAGE=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022
FROM ${BUILD_BASE_IMAGE} AS builder
FROM $BASE_IMAGE
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" `
@ -24,37 +29,40 @@ LABEL org.opencontainers.image.title="Zabbix agent" `
org.opencontainers.image.version="${ZBX_VERSION}" `
org.opencontainers.image.source="${ZBX_SOURCES}"
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';"]
COPY --from=builder ["C:\\zabbix-${ZBX_VERSION}-output", "C:\\zabbix"]
COPY --from=builder ["C:\\build_deps\\pwsh", "C:\\Program Files\\PowerShell"]
COPY [".\\docker-entrypoint.ps1", "C:\\zabbix"]
WORKDIR C:\zabbix\
COPY --from=builder ["C:\\zabbix-${ZBX_VERSION}-output", "C:\\zabbix"]
COPY [".\\docker-entrypoint.ps1", "C:\\zabbix"]
USER ContainerAdministrator
RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell"
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';"]
RUN $env:PATH = [string]::Format('{0}\zabbix\sbin;{0}\zabbix\bin;', $env:SystemDrive) + $env:PATH; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
$env:ZBX_HOME = [string]::Format('{0}\zabbix', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('ZBX_HOME', $env:ZBX_HOME, [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:ZBX_HOME\conf\zabbix_agentd.d | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_HOME\enc | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_HOME\modules | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_HOME\buffer | Out-Null; `
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:ZBX_HOME; `
$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:ZBX_HOME;
Set-Acl -AclObject $acl -Path $env:ZABBIX_USER_HOME_DIR;
USER zabbix

View File

@ -4,22 +4,18 @@ if ($env:DEBUG_MODE -eq "true") {
Set-PSDebug -trace 1
}
# Default Zabbix installation name
# Default Zabbix server host
if ([string]::IsNullOrWhitespace($env:ZBX_SERVER_HOST)) {
if ($env:ZBX_SERVER_HOST -eq $null) {
$env:ZBX_SERVER_HOST="zabbix-server"
}
# Default Zabbix server port number
if ([string]::IsNullOrWhitespace($env:ZBX_SERVER_PORT)) {
if ($env:ZBX_SERVER_PORT -eq $null) {
$env:ZBX_SERVER_PORT="10051"
}
# Default directories
# User 'zabbix' home directory
$ZabbixUserHomeDir="C:\zabbix"
# Configuration files directory
$ZabbixConfigDir="C:\zabbix\conf"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
$ZabbixInternalEncDir="$env:ZABBIX_USER_HOME_DIR/enc_internal"
function Update-Config-Var {
Param (
@ -66,7 +62,7 @@ function Update-Config-Var {
}
if ($VarName -match '^TLS.*File$') {
$VarValue="$ZabbixUserHomeDir\enc\$VarValue"
$VarValue="$env:ZABBIX_USER_HOME_DIR\enc\$VarValue"
}
if ((Get-Content $ConfigPath | %{$_ -match "^$VarName="}) -contains $true -And $IsMultiple -ne $true) {
@ -119,109 +115,105 @@ function Update-Config-Multiple-Var {
}
}
function File-Process-From-Env {
Param (
[Parameter(Mandatory=$true, Position=0)]
[ValidateNotNullOrEmpty()]
[string] $VarName,
[Parameter(Mandatory=$false, Position=1)]
[string]$FileName = $null,
[Parameter(Mandatory=$false, Position=2)]
[string]$VarValue = $null
)
if (![string]::IsNullOrEmpty($VarValue)) {
$VarValue | Set-Content "$ZabbixInternalEncDir\$VarName"
$FileName="$ZabbixInternalEncDir\$VarName"
}
if (![string]::IsNullOrEmpty($FileName)) {
Set-Item env:$VarName -Value $FileName
}
$VarName=$VarName -replace 'FILE$'
Set-Item env:$VarName -Value $null
}
function Prepare-Zbx-Agent-Config {
Write-Host "** Preparing Zabbix agent configuration file"
$ZbxAgentConfig="$ZabbixConfigDir\zabbix_agentd.conf"
if ([string]::IsNullOrWhitespace($env:ZBX_PASSIVESERVERS)) {
if ($env:ZBX_PASSIVESERVERS -eq $null) {
$env:ZBX_PASSIVESERVERS=""
}
else {
$env:ZBX_PASSIVESERVERS=",$env:ZBX_PASSIVESERVERS"
}
$env:ZBX_PASSIVESERVERS=$env:ZBX_SERVER_HOST + $env:ZBX_PASSIVESERVERS
if ([string]::IsNullOrWhitespace($env:ZBX_ACTIVESERVERS)) {
if ($env:ZBX_ACTIVESERVERS -eq $null) {
$env:ZBX_ACTIVESERVERS=""
}
else {
$env:ZBX_ACTIVESERVERS=",$env:ZBX_ACTIVESERVERS"
if (![string]::IsNullOrEmpty($env:ZBX_SERVER_HOST) -And ![string]::IsNullOrEmpty($env:ZBX_PASSIVESERVERS)) {
$env:ZBX_PASSIVESERVERS="$env:ZBX_SERVER_HOST,$env:ZBX_PASSIVESERVERS"
}
elseif (![string]::IsNullOrEmpty($env:ZBX_SERVER_HOST)) {
$env:ZBX_PASSIVESERVERS=$env:ZBX_SERVER_HOST
}
$env:ZBX_ACTIVESERVERS=$env:ZBX_SERVER_HOST + ":" + $env:ZBX_SERVER_PORT + $env:ZBX_ACTIVESERVERS
Update-Config-Var $ZbxAgentConfig "LogType" "console"
Update-Config-Var $ZbxAgentConfig "LogFile"
Update-Config-Var $ZbxAgentConfig "LogFileSize"
Update-Config-Var $ZbxAgentConfig "DebugLevel" "$env:ZBX_DEBUGLEVEL"
Update-Config-Var $ZbxAgentConfig "SourceIP"
Update-Config-Var $ZbxAgentConfig "LogRemoteCommands" "$env:ZBX_LOGREMOTECOMMANDS"
if (![string]::IsNullOrEmpty($env:ZBX_SERVER_HOST)) {
if (![string]::IsNullOrEmpty($env:ZBX_SERVER_PORT) -And $env:ZBX_SERVER_PORT -ne "10051") {
$env:ZBX_SERVER_HOST="$env:ZBX_SERVER_HOST:$env:ZBX_SERVER_PORT"
}
if (![string]::IsNullOrEmpty($env:ZBX_ACTIVESERVERS)) {
$env:ZBX_ACTIVESERVERS="$env:ZBX_SERVER_HOST,$env:ZBX_ACTIVESERVERS"
}
else {
$env:ZBX_ACTIVESERVERS=$env:ZBX_SERVER_HOST
}
}
if ([string]::IsNullOrWhitespace($env:ZBX_PASSIVE_ALLOW)) {
$env:ZBX_PASSIVE_ALLOW="true"
}
if ($env:ZBX_PASSIVE_ALLOW -eq "true") {
Write-Host "** Using '$env:ZBX_PASSIVESERVERS' servers for passive checks"
Update-Config-Var $ZbxAgentConfig "Server" "$env:ZBX_PASSIVESERVERS"
Write-Host "** Using '$env:ZBX_PASSIVESERVERS' servers for passive checks"
}
else {
Update-Config-Var $ZbxAgentConfig "Server"
Set-Item env:ZBX_PASSIVESERVERS -Value $null
}
Update-Config-Var $ZbxAgentConfig "ListenPort" "$env:ZBX_LISTENPORT"
Update-Config-Var $ZbxAgentConfig "ListenIP" "$env:ZBX_LISTENIP"
Update-Config-Var $ZbxAgentConfig "StartAgents" "$env:ZBX_STARTAGENTS"
if ([string]::IsNullOrWhitespace($env:ZBX_ACTIVE_ALLOW)) {
$env:ZBX_ACTIVE_ALLOW="true"
}
if ($env:ZBX_ACTIVE_ALLOW -eq "true") {
Write-Host "** Using '$env:ZBX_ACTIVESERVERS' servers for active checks"
Update-Config-Var $ZbxAgentConfig "ServerActive" "$env:ZBX_ACTIVESERVERS"
}
else {
Update-Config-Var $ZbxAgentConfig "ServerActive"
Set-Item env:ZBX_ACTIVESERVERS -Value $null
}
Update-Config-Var $ZbxAgentConfig "HeartbeatFrequency" "$env:ZBX_HEARTBEAT_FREQUENCY"
Update-Config-Var $ZbxAgentConfig "HostInterface" "$env:ZBX_HOSTINTERFACE"
Update-Config-Var $ZbxAgentConfig "HostInterfaceItem" "$env:ZBX_HOSTINTERFACEITEM"
Update-Config-Multiple-Var "$env:ZABBIX_CONF_DIR\zabbix_agentd_item_keys.conf" "DenyKey" "$env:ZBX_DENYKEY"
Update-Config-Multiple-Var "$env:ZABBIX_CONF_DIR\zabbix_agentd_item_keys.conf" "AllowKey" "$env:ZBX_ALLOWKEY"
Update-Config-Var $ZbxAgentConfig "Hostname" "$env:ZBX_HOSTNAME"
Update-Config-Var $ZbxAgentConfig "HostnameItem" "$env:ZBX_HOSTNAMEITEM"
Update-Config-Var $ZbxAgentConfig "HostMetadata" "$env:ZBX_METADATA"
Update-Config-Var $ZbxAgentConfig "HostMetadataItem" "$env:ZBX_METADATAITEM"
Update-Config-Var $ZbxAgentConfig "RefreshActiveChecks" "$env:ZBX_REFRESHACTIVECHECKS"
Update-Config-Var $ZbxAgentConfig "BufferSend" "$env:ZBX_BUFFERSEND"
Update-Config-Var $ZbxAgentConfig "BufferSize" "$env:ZBX_BUFFERSIZE"
Update-Config-Var $ZbxAgentConfig "MaxLinesPerSecond" "$env:ZBX_MAXLINESPERSECOND"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" $env:ZBX_ALIAS
# Please use include to enable Perfcounter feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "PerfCounter" $env:ZBX_PERFCOUNTER
Update-Config-Var $ZbxAgentConfig "Timeout" "$env:ZBX_TIMEOUT"
Update-Config-Var $ZbxAgentConfig "Include" "$ZabbixConfigDir\zabbix_agentd.d\*.conf"
Update-Config-Var $ZbxAgentConfig "UnsafeUserParameters" "$env:ZBX_UNSAFEUSERPARAMETERS"
Update-Config-Var $ZbxAgentConfig "UserParameterDir" "$ZabbixUserHomeDir\user_scripts\"
Update-Config-Var $ZbxAgentConfig "TLSConnect" "$env:ZBX_TLSCONNECT"
Update-Config-Var $ZbxAgentConfig "TLSAccept" "$env:ZBX_TLSACCEPT"
Update-Config-Var $ZbxAgentConfig "TLSCAFile" "$env:ZBX_TLSCAFILE"
Update-Config-Var $ZbxAgentConfig "TLSCRLFile" "$env:ZBX_TLSCRLFILE"
Update-Config-Var $ZbxAgentConfig "TLSServerCertIssuer" "$env:ZBX_TLSSERVERCERTISSUER"
Update-Config-Var $ZbxAgentConfig "TLSServerCertSubject" "$env:ZBX_TLSSERVERCERTSUBJECT"
Update-Config-Var $ZbxAgentConfig "TLSCertFile" "$env:ZBX_TLSCERTFILE"
Update-Config-Var $ZbxAgentConfig "TLSCipherAll" "$env:ZBX_TLSCIPHERALL"
Update-Config-Var $ZbxAgentConfig "TLSCipherAll13" "$env:ZBX_TLSCIPHERALL13"
Update-Config-Var $ZbxAgentConfig "TLSCipherCert" "$env:ZBX_TLSCIPHERCERT"
Update-Config-Var $ZbxAgentConfig "TLSCipherCert13" "$env:ZBX_TLSCIPHERCERT13"
Update-Config-Var $ZbxAgentConfig "TLSCipherPSK" "$env:ZBX_TLSCIPHERPSK"
Update-Config-Var $ZbxAgentConfig "TLSCipherPSK13" "$env:ZBX_TLSCIPHERPSK13"
Update-Config-Var $ZbxAgentConfig "TLSKeyFile" "$env:ZBX_TLSKEYFILE"
Update-Config-Var $ZbxAgentConfig "TLSPSKIdentity" "$env:ZBX_TLSPSKIDENTITY"
Update-Config-Var $ZbxAgentConfig "TLSPSKFile" "$env:ZBX_TLSPSKFILE"
File-Process-From-Env "ZBX_TLSCAFILE" "$env:ZBX_TLSCAFILE" "$env:ZBX_TLSCA"
File-Process-From-Env "ZBX_TLSCRLFILE" "$env:ZBX_TLSCRLFILE" "$env:ZBX_TLSCRL"
File-Process-From-Env "ZBX_TLSCERTFILE" "$env:ZBX_TLSCERTFILE" "$env:ZBX_TLSCERT"
File-Process-From-Env "ZBX_TLSKEYFILE" "$env:ZBX_TLSKEYFILE" "$env:ZBX_TLSKEY"
File-Process-From-Env "ZBX_TLSPSKFILE" "$env:ZBX_TLSPSKFILE" "$env:ZBX_TLSPSK"
}
Update-Config-Multiple-Var $ZbxAgentConfig "DenyKey" "$env:ZBX_DENYKEY"
Update-Config-Multiple-Var $ZbxAgentConfig "AllowKey" "$env:ZBX_ALLOWKEY"
function ClearZbxEnv() {
if ([string]::IsNullOrWhitespace($env:ZBX_CLEAR_ENV)) {
return
}
$env_vars=Get-ChildItem env:* | Where-Object {$_.Name -match "^ZABBIX_.*" } | foreach { $_.Name }
foreach ($env_var in $env_vars) {
Set-Item env:$env_var -Value $null
}
}
function PrepareAgent {
Write-Host "** Preparing Zabbix agent"
Prepare-Zbx-Agent-Config
ClearZbxEnv
}
$commandArgs=$args

View File

@ -14,15 +14,17 @@ Zabbix agent 2 is deployed on a monitoring target to actively monitor local reso
# Zabbix agent 2 images
These are the only official Zabbix agent 2 Docker images. They are based on Alpine Linux v3.20, Ubuntu 24.04 (noble), CentOS Stream 9, Oracle Linux 9, Windows 10 LTSC 2019 and Windows 11 LTSC 2022 images. The available versions of Zabbix agent 2 are:
These are the only official Zabbix agent 2 Docker images. They are based on Alpine Linux v3.23, Ubuntu 24.04 (noble), 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 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, ol-5.0-latest , ltsc2019-5.0-latest, ltsc2022-5.0-latest)
Zabbix agent 2 5.0.* (tags: alpine-5.0.*, ubuntu-5.0.*, ol-5.0.*, ltsc2019-5.0.*, ltsc2022-5.0.*)
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 6.4 (tags: alpine-6.4-latest, ubuntu-6.4-latest, ol-6.4-latest, alpine-latest, ubuntu-latest, ol-latest, ltsc2019-latest, ltsc2022-latest, latest)
Zabbix agent 2 6.4.* (tags: alpine-6.4.*, ubuntu-6.4.*, ol-6.4.*, ltsc2019-6.4.*, ltsc2022-6.4.*)
Zabbix agent 2 7.0 (tags: alpine-trunk, ubuntu-trunk, ol-trunk, ltsc2019-trunk, ltsc2022-trunk)
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.
@ -145,13 +147,18 @@ 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_DENYKEY=system.run[*] # Available since 5.0.0
ZBX_ALLOWKEY= # Available since 5.0.0
```
@ -170,7 +177,7 @@ The volume allows include ``*.conf`` files and extend Zabbix agent 2 using ``Use
### ``/var/lib/zabbix/enc``
The volume is used to store TLS related files. These file names are specified using ``ZBX_TLSCAFILE``, ``ZBX_TLSCRLFILE``, ``ZBX_TLSKEY_FILE`` and ``ZBX_TLSPSKFILE`` variables.
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``
@ -208,7 +215,7 @@ Please see [the Docker installation documentation](https://docs.docker.com/insta
## Documentation
Documentation for this image is stored in the [`agent2/` directory](https://github.com/zabbix/zabbix-docker/tree/trunk/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/trunk/README.md) before attempting a pull request.
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

View File

@ -1,18 +1,24 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=alpine:3.23
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:alpine-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM alpine:3.20
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}
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" \
@ -28,7 +34,7 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/", "/usr/sbin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/", "/etc/zabbix/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/", "${ZABBIX_CONF_DIR}/"]
RUN set -eux && \
INSTALL_PKGS="bash \
@ -53,22 +59,37 @@ RUN set -eux && \
--uid 1997 \
--ingroup zabbix \
--shell /sbin/nologin \
--home /var/lib/zabbix/ \
--home ${ZABBIX_USER_HOME_DIR}/ \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/buffer && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/
mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agent2.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
EXPOSE 10050/TCP 31999/TCP
WORKDIR /var/lib/zabbix
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -11,15 +11,13 @@ fi
# Default Zabbix installation name
# Default Zabbix server host
: ${ZBX_SERVER_HOST:="zabbix-server"}
: ${ZBX_SERVER_HOST="zabbix-server"}
# Default Zabbix server port number
: ${ZBX_SERVER_PORT:="10051"}
: ${ZBX_SERVER_PORT="10051"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
ZABBIX_INTERNAL_ENC_DIR="${ZABBIX_USER_HOME_DIR}/enc_internal"
escape_spec_char() {
local var_value=$1
@ -57,16 +55,20 @@ update_config_var() {
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value
# Remove configuration parameter definition in case of unset or empty parameter value
if [ -z "$var_value" ]; then
sed -i -e "/^$var_name=/d" "$config_path"
echo "removed"
return
fi
# Remove value from configuration parameter in case of double quoted parameter value
if [ "$var_value" == '""' ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
# Remove value from configuration parameter in case of set to double quoted parameter value
if [[ "$var_value" == '""' ]]; then
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
else
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
fi
echo "undefined"
return
fi
@ -80,7 +82,9 @@ update_config_var() {
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
if [ "$(grep -E "^$var_name=$var_value$" $config_path)" ]; then
echo "exists"
elif [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
echo "updated"
elif [ "$(grep -Ec "^# $var_name=" $config_path)" -gt 1 ]; then
@ -112,105 +116,111 @@ update_config_multiple_var() {
done
}
file_process_from_env() {
local var_name=$1
local file_name=$2
local var_value=$3
if [ ! -z "$var_value" ]; then
echo -n "$var_value" > "${ZABBIX_INTERNAL_ENC_DIR}/$var_name"
file_name="${ZABBIX_INTERNAL_ENC_DIR}/${var_name}"
fi
if [ -n "$var_value" ]; then
export "$var_name"="$file_name"
fi
# Remove variable with plain text data
unset "${var_name%%FILE}"
}
prepare_zbx_agent_config() {
echo "** Preparing Zabbix agent configuration file"
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agent2.conf
: ${ZBX_PASSIVESERVERS=""}
: ${ZBX_ACTIVESERVERS=""}
: ${ZBX_PASSIVESERVERS:=""}
: ${ZBX_ACTIVESERVERS:=""}
if [ ! -z "$ZBX_SERVER_HOST" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST","$ZBX_PASSIVESERVERS
elif [ ! -z "$ZBX_SERVER_HOST" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST
fi
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
update_config_var $ZBX_AGENT_CONFIG "PidFile"
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
update_config_var $ZBX_AGENT_CONFIG "LogFile"
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
if [ ! -z "$ZBX_SERVER_HOST" ]; then
if [ ! -z "$ZBX_SERVER_PORT" ] && [ "$ZBX_SERVER_PORT" != "10051" ]; then
ZBX_SERVER_HOST=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT
fi
if [ ! -z "$ZBX_ACTIVESERVERS" ]; then
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST","$ZBX_ACTIVESERVERS
else
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST
fi
fi
: ${ZBX_PASSIVE_ALLOW:="true"}
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
export ZBX_PASSIVESERVERS="${ZBX_PASSIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "Server"
unset ZBX_PASSIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_AGENT_CONFIG "ListenIP" "${ZBX_LISTENIP}"
: ${ZBX_ACTIVE_ALLOW:="true"}
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_ACTIVESERVERS" ]; then
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
export ZBX_ACTIVESERVERS="${ZBX_ACTIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
unset ZBX_ACTIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "HeartbeatFrequency" "${ZBX_HEARTBEAT_FREQUENCY}"
update_config_var $ZBX_AGENT_CONFIG "ForceActiveChecksOnStart" "${ZBX_FORCEACTIVECHECKSONSTART}"
unset ZBX_SERVER_HOST
unset ZBX_SERVER_PORT
if [ "${ZBX_ENABLEPERSISTENTBUFFER,,}" == "true" ]; then
update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "1"
update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/agent2.db"
update_config_var $ZBX_AGENT_CONFIG "PersistentBufferPeriod" "${ZBX_PERSISTENTBUFFERPERIOD}"
export ZBX_ENABLEPERSISTENTBUFFER=1
else
update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "0"
unset ZBX_ENABLEPERSISTENTBUFFER
unset ZBX_PERSISTENTBUFFERFILE
fi
if [ "${ZBX_ENABLESTATUSPORT,,}" == "true" ]; then
update_config_var $ZBX_AGENT_CONFIG "StatusPort" "31999"
export ZBX_STATUSPORT=${ZBX_STATUSPORT="31999"}
else
unset ZBX_STATUSPORT
fi
update_config_var $ZBX_AGENT_CONFIG "HostInterface" "${ZBX_HOSTINTERFACE}"
update_config_var $ZBX_AGENT_CONFIG "HostInterfaceItem" "${ZBX_HOSTINTERFACEITEM}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf" "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf" "AllowKey" "${ZBX_ALLOWKEY}"
update_config_var $ZBX_AGENT_CONFIG "Hostname" "${ZBX_HOSTNAME}"
update_config_var $ZBX_AGENT_CONFIG "HostnameItem" "${ZBX_HOSTNAMEITEM}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadata" "${ZBX_METADATA}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadataItem" "${ZBX_METADATAITEM}"
update_config_var $ZBX_AGENT_CONFIG "RefreshActiveChecks" "${ZBX_REFRESHACTIVECHECKS}"
update_config_var $ZBX_AGENT_CONFIG "BufferSend" "${ZBX_BUFFERSEND}"
update_config_var $ZBX_AGENT_CONFIG "BufferSize" "${ZBX_BUFFERSIZE}"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" "true"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCRLFile" "${ZBX_TLSCRLFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
update_config_multiple_var $ZBX_AGENT_CONFIG "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var $ZBX_AGENT_CONFIG "AllowKey" "${ZBX_ALLOWKEY}"
file_process_from_env "ZBX_TLSCAFILE" "${ZBX_TLSCAFILE}" "${ZBX_TLSCA}"
file_process_from_env "ZBX_TLSCRLFILE" "${ZBX_TLSCRLFILE}" "${ZBX_TLSCRL}"
file_process_from_env "ZBX_TLSCERTFILE" "${ZBX_TLSCERTFILE}" "${ZBX_TLSCERT}"
file_process_from_env "ZBX_TLSKEYFILE" "${ZBX_TLSKEYFILE}" "${ZBX_TLSKEY}"
file_process_from_env "ZBX_TLSPSKFILE" "${ZBX_TLSPSKFILE}" "${ZBX_TLSPSK}"
}
prepare_zbx_agent_plugin_config() {
echo "** Preparing Zabbix agent plugin configuration files"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
if command -v nvidia-smi 2>&1 >/dev/null
then
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu"
fi
}
clear_zbx_env() {
[[ "${ZBX_CLEAR_ENV}" == "false" ]] && return
for env_var in $(env | grep -E "^ZABBIX_"); do
unset "${env_var%%=*}"
done
}
prepare_agent() {
echo "** Preparing Zabbix agent"
prepare_zbx_agent_config
prepare_zbx_agent_plugin_config
clear_zbx_env
}
#################################################

View File

@ -1,18 +1,24 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=quay.io/centos/centos:stream10-minimal
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:centos-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM quay.io/centos/centos:stream9-minimal
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}
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" \
@ -28,9 +34,10 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/", "/usr/sbin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/", "/etc/zabbix/"]
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 \
iputils \
@ -73,23 +80,37 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/buffer && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
microdnf -y clean all
mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agent2.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
EXPOSE 10050/TCP 31999/TCP
WORKDIR /var/lib/zabbix
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -11,15 +11,13 @@ fi
# Default Zabbix installation name
# Default Zabbix server host
: ${ZBX_SERVER_HOST:="zabbix-server"}
: ${ZBX_SERVER_HOST="zabbix-server"}
# Default Zabbix server port number
: ${ZBX_SERVER_PORT:="10051"}
: ${ZBX_SERVER_PORT="10051"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
ZABBIX_INTERNAL_ENC_DIR="${ZABBIX_USER_HOME_DIR}/enc_internal"
escape_spec_char() {
local var_value=$1
@ -57,16 +55,20 @@ update_config_var() {
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value
# Remove configuration parameter definition in case of unset or empty parameter value
if [ -z "$var_value" ]; then
sed -i -e "/^$var_name=/d" "$config_path"
echo "removed"
return
fi
# Remove value from configuration parameter in case of double quoted parameter value
if [ "$var_value" == '""' ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
# Remove value from configuration parameter in case of set to double quoted parameter value
if [[ "$var_value" == '""' ]]; then
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
else
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
fi
echo "undefined"
return
fi
@ -80,7 +82,9 @@ update_config_var() {
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
if [ "$(grep -E "^$var_name=$var_value$" $config_path)" ]; then
echo "exists"
elif [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
echo "updated"
elif [ "$(grep -Ec "^# $var_name=" $config_path)" -gt 1 ]; then
@ -112,105 +116,111 @@ update_config_multiple_var() {
done
}
file_process_from_env() {
local var_name=$1
local file_name=$2
local var_value=$3
if [ ! -z "$var_value" ]; then
echo -n "$var_value" > "${ZABBIX_INTERNAL_ENC_DIR}/$var_name"
file_name="${ZABBIX_INTERNAL_ENC_DIR}/${var_name}"
fi
if [ -n "$var_value" ]; then
export "$var_name"="$file_name"
fi
# Remove variable with plain text data
unset "${var_name%%FILE}"
}
prepare_zbx_agent_config() {
echo "** Preparing Zabbix agent configuration file"
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agent2.conf
: ${ZBX_PASSIVESERVERS=""}
: ${ZBX_ACTIVESERVERS=""}
: ${ZBX_PASSIVESERVERS:=""}
: ${ZBX_ACTIVESERVERS:=""}
if [ ! -z "$ZBX_SERVER_HOST" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST","$ZBX_PASSIVESERVERS
elif [ ! -z "$ZBX_SERVER_HOST" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST
fi
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
update_config_var $ZBX_AGENT_CONFIG "PidFile"
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
update_config_var $ZBX_AGENT_CONFIG "LogFile"
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
if [ ! -z "$ZBX_SERVER_HOST" ]; then
if [ ! -z "$ZBX_SERVER_PORT" ] && [ "$ZBX_SERVER_PORT" != "10051" ]; then
ZBX_SERVER_HOST=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT
fi
if [ ! -z "$ZBX_ACTIVESERVERS" ]; then
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST","$ZBX_ACTIVESERVERS
else
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST
fi
fi
: ${ZBX_PASSIVE_ALLOW:="true"}
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
export ZBX_PASSIVESERVERS="${ZBX_PASSIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "Server"
unset ZBX_PASSIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_AGENT_CONFIG "ListenIP" "${ZBX_LISTENIP}"
: ${ZBX_ACTIVE_ALLOW:="true"}
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_ACTIVESERVERS" ]; then
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
export ZBX_ACTIVESERVERS="${ZBX_ACTIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
unset ZBX_ACTIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "HeartbeatFrequency" "${ZBX_HEARTBEAT_FREQUENCY}"
update_config_var $ZBX_AGENT_CONFIG "ForceActiveChecksOnStart" "${ZBX_FORCEACTIVECHECKSONSTART}"
unset ZBX_SERVER_HOST
unset ZBX_SERVER_PORT
if [ "${ZBX_ENABLEPERSISTENTBUFFER,,}" == "true" ]; then
update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "1"
update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/agent2.db"
update_config_var $ZBX_AGENT_CONFIG "PersistentBufferPeriod" "${ZBX_PERSISTENTBUFFERPERIOD}"
export ZBX_ENABLEPERSISTENTBUFFER=1
else
update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "0"
unset ZBX_ENABLEPERSISTENTBUFFER
unset ZBX_PERSISTENTBUFFERFILE
fi
if [ "${ZBX_ENABLESTATUSPORT,,}" == "true" ]; then
update_config_var $ZBX_AGENT_CONFIG "StatusPort" "31999"
export ZBX_STATUSPORT=${ZBX_STATUSPORT="31999"}
else
unset ZBX_STATUSPORT
fi
update_config_var $ZBX_AGENT_CONFIG "HostInterface" "${ZBX_HOSTINTERFACE}"
update_config_var $ZBX_AGENT_CONFIG "HostInterfaceItem" "${ZBX_HOSTINTERFACEITEM}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf" "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf" "AllowKey" "${ZBX_ALLOWKEY}"
update_config_var $ZBX_AGENT_CONFIG "Hostname" "${ZBX_HOSTNAME}"
update_config_var $ZBX_AGENT_CONFIG "HostnameItem" "${ZBX_HOSTNAMEITEM}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadata" "${ZBX_METADATA}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadataItem" "${ZBX_METADATAITEM}"
update_config_var $ZBX_AGENT_CONFIG "RefreshActiveChecks" "${ZBX_REFRESHACTIVECHECKS}"
update_config_var $ZBX_AGENT_CONFIG "BufferSend" "${ZBX_BUFFERSEND}"
update_config_var $ZBX_AGENT_CONFIG "BufferSize" "${ZBX_BUFFERSIZE}"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" "true"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCRLFile" "${ZBX_TLSCRLFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
update_config_multiple_var $ZBX_AGENT_CONFIG "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var $ZBX_AGENT_CONFIG "AllowKey" "${ZBX_ALLOWKEY}"
file_process_from_env "ZBX_TLSCAFILE" "${ZBX_TLSCAFILE}" "${ZBX_TLSCA}"
file_process_from_env "ZBX_TLSCRLFILE" "${ZBX_TLSCRLFILE}" "${ZBX_TLSCRL}"
file_process_from_env "ZBX_TLSCERTFILE" "${ZBX_TLSCERTFILE}" "${ZBX_TLSCERT}"
file_process_from_env "ZBX_TLSKEYFILE" "${ZBX_TLSKEYFILE}" "${ZBX_TLSKEY}"
file_process_from_env "ZBX_TLSPSKFILE" "${ZBX_TLSPSKFILE}" "${ZBX_TLSPSK}"
}
prepare_zbx_agent_plugin_config() {
echo "** Preparing Zabbix agent plugin configuration files"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
if command -v nvidia-smi 2>&1 >/dev/null
then
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu"
fi
}
clear_zbx_env() {
[[ "${ZBX_CLEAR_ENV}" == "false" ]] && return
for env_var in $(env | grep -E "^ZABBIX_"); do
unset "${env_var%%=*}"
done
}
prepare_agent() {
echo "** Preparing Zabbix agent"
prepare_zbx_agent_config
prepare_zbx_agent_plugin_config
clear_zbx_env
}
#################################################

View File

@ -1,18 +1,24 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ol-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM oraclelinux:9-slim
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}
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" \
@ -28,10 +34,11 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/", "/usr/sbin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/", "/etc/zabbix/"]
COPY ["conf/etc/yum.repos.d/oracle-epel-ol9.repo", "/etc/yum.repos.d/oracle-epel-ol9.repo"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/", "${ZABBIX_CONF_DIR}/"]
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
iputils \
@ -42,9 +49,9 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
openssl-libs" && \
microdnf -y install \
--disablerepo="*" \
--enablerepo="ol9_baseos_latest" \
--enablerepo="ol9_appstream" \
--enablerepo="ol9_developer_EPEL" \
--enablerepo="ol10_baseos_latest" \
--enablerepo="ol10_appstream" \
--enablerepo="ol10_u0_developer_EPEL" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
@ -60,23 +67,37 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/buffer && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
microdnf -y clean all
mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agent2.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
EXPOSE 10050/TCP 31999/TCP
WORKDIR /var/lib/zabbix
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -0,0 +1,6 @@
[ol10_u0_developer_EPEL]
name=Oracle Linux $releasever.0 EPEL Packages for Development ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL10/0/developer/EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

View File

@ -1,6 +0,0 @@
[ol9_developer_EPEL]
name=Oracle Linux $releasever EPEL Packages for Development ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL9/developer/EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

View File

@ -11,15 +11,13 @@ fi
# Default Zabbix installation name
# Default Zabbix server host
: ${ZBX_SERVER_HOST:="zabbix-server"}
: ${ZBX_SERVER_HOST="zabbix-server"}
# Default Zabbix server port number
: ${ZBX_SERVER_PORT:="10051"}
: ${ZBX_SERVER_PORT="10051"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
ZABBIX_INTERNAL_ENC_DIR="${ZABBIX_USER_HOME_DIR}/enc_internal"
escape_spec_char() {
local var_value=$1
@ -57,16 +55,20 @@ update_config_var() {
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value
# Remove configuration parameter definition in case of unset or empty parameter value
if [ -z "$var_value" ]; then
sed -i -e "/^$var_name=/d" "$config_path"
echo "removed"
return
fi
# Remove value from configuration parameter in case of double quoted parameter value
if [ "$var_value" == '""' ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
# Remove value from configuration parameter in case of set to double quoted parameter value
if [[ "$var_value" == '""' ]]; then
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
else
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
fi
echo "undefined"
return
fi
@ -80,7 +82,9 @@ update_config_var() {
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
if [ "$(grep -E "^$var_name=$var_value$" $config_path)" ]; then
echo "exists"
elif [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
echo "updated"
elif [ "$(grep -Ec "^# $var_name=" $config_path)" -gt 1 ]; then
@ -112,105 +116,112 @@ update_config_multiple_var() {
done
}
file_process_from_env() {
local config_path=$1
local var_name=$2
local file_name=$3
local var_value=$4
if [ ! -z "$var_value" ]; then
echo -n "$var_value" > "${ZABBIX_INTERNAL_ENC_DIR}/$var_name"
file_name="${ZABBIX_INTERNAL_ENC_DIR}/${var_name}"
fi
if [ -n "$var_value" ]; then
export "$var_name"="$file_name"
fi
# Remove variable with plain text data
unset "${var_name%%FILE}"
}
prepare_zbx_agent_config() {
echo "** Preparing Zabbix agent configuration file"
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agent2.conf
: ${ZBX_PASSIVESERVERS=""}
: ${ZBX_ACTIVESERVERS=""}
: ${ZBX_PASSIVESERVERS:=""}
: ${ZBX_ACTIVESERVERS:=""}
if [ ! -z "$ZBX_SERVER_HOST" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST","$ZBX_PASSIVESERVERS
elif [ ! -z "$ZBX_SERVER_HOST" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST
fi
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
update_config_var $ZBX_AGENT_CONFIG "PidFile"
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
update_config_var $ZBX_AGENT_CONFIG "LogFile"
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
if [ ! -z "$ZBX_SERVER_HOST" ]; then
if [ ! -z "$ZBX_SERVER_PORT" ] && [ "$ZBX_SERVER_PORT" != "10051" ]; then
ZBX_SERVER_HOST=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT
fi
if [ ! -z "$ZBX_ACTIVESERVERS" ]; then
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST","$ZBX_ACTIVESERVERS
else
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST
fi
fi
: ${ZBX_PASSIVE_ALLOW:="true"}
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
export ZBX_PASSIVESERVERS="${ZBX_PASSIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "Server"
unset ZBX_PASSIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_AGENT_CONFIG "ListenIP" "${ZBX_LISTENIP}"
: ${ZBX_ACTIVE_ALLOW:="true"}
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_ACTIVESERVERS" ]; then
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
export ZBX_ACTIVESERVERS="${ZBX_ACTIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
unset ZBX_ACTIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "HeartbeatFrequency" "${ZBX_HEARTBEAT_FREQUENCY}"
update_config_var $ZBX_AGENT_CONFIG "ForceActiveChecksOnStart" "${ZBX_FORCEACTIVECHECKSONSTART}"
unset ZBX_SERVER_HOST
unset ZBX_SERVER_PORT
if [ "${ZBX_ENABLEPERSISTENTBUFFER,,}" == "true" ]; then
update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "1"
update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/agent2.db"
update_config_var $ZBX_AGENT_CONFIG "PersistentBufferPeriod" "${ZBX_PERSISTENTBUFFERPERIOD}"
export ZBX_ENABLEPERSISTENTBUFFER=1
else
update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "0"
unset ZBX_ENABLEPERSISTENTBUFFER
unset ZBX_PERSISTENTBUFFERFILE
fi
if [ "${ZBX_ENABLESTATUSPORT,,}" == "true" ]; then
update_config_var $ZBX_AGENT_CONFIG "StatusPort" "31999"
export ZBX_STATUSPORT=${ZBX_STATUSPORT="31999"}
else
unset ZBX_STATUSPORT
fi
update_config_var $ZBX_AGENT_CONFIG "HostInterface" "${ZBX_HOSTINTERFACE}"
update_config_var $ZBX_AGENT_CONFIG "HostInterfaceItem" "${ZBX_HOSTINTERFACEITEM}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf" "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf" "AllowKey" "${ZBX_ALLOWKEY}"
update_config_var $ZBX_AGENT_CONFIG "Hostname" "${ZBX_HOSTNAME}"
update_config_var $ZBX_AGENT_CONFIG "HostnameItem" "${ZBX_HOSTNAMEITEM}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadata" "${ZBX_METADATA}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadataItem" "${ZBX_METADATAITEM}"
update_config_var $ZBX_AGENT_CONFIG "RefreshActiveChecks" "${ZBX_REFRESHACTIVECHECKS}"
update_config_var $ZBX_AGENT_CONFIG "BufferSend" "${ZBX_BUFFERSEND}"
update_config_var $ZBX_AGENT_CONFIG "BufferSize" "${ZBX_BUFFERSIZE}"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" "true"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCRLFile" "${ZBX_TLSCRLFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
update_config_multiple_var $ZBX_AGENT_CONFIG "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var $ZBX_AGENT_CONFIG "AllowKey" "${ZBX_ALLOWKEY}"
file_process_from_env "ZBX_TLSCAFILE" "${ZBX_TLSCAFILE}" "${ZBX_TLSCA}"
file_process_from_env "ZBX_TLSCRLFILE" "${ZBX_TLSCRLFILE}" "${ZBX_TLSCRL}"
file_process_from_env "ZBX_TLSCERTFILE" "${ZBX_TLSCERTFILE}" "${ZBX_TLSCERT}"
file_process_from_env "ZBX_TLSKEYFILE" "${ZBX_TLSKEYFILE}" "${ZBX_TLSKEY}"
file_process_from_env "ZBX_TLSPSKFILE" "${ZBX_TLSPSKFILE}" "${ZBX_TLSPSK}"
}
prepare_zbx_agent_plugin_config() {
echo "** Preparing Zabbix agent plugin configuration files"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
if command -v nvidia-smi 2>&1 >/dev/null
then
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu"
fi
}
clear_zbx_env() {
[[ "${ZBX_CLEAR_ENV}" == "false" ]] && return
for env_var in $(env | grep -E "^ZABBIX_"); do
unset "${env_var%%=*}"
done
}
prepare_agent() {
echo "** Preparing Zabbix agent"
prepare_zbx_agent_config
prepare_zbx_agent_plugin_config
clear_zbx_env
}
#################################################

View File

@ -1,12 +1,13 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG RELEASE=0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=registry.access.redhat.com/ubi10/ubi-minimal:10.1
ARG MAJOR_VERSION=7.4
ARG RELEASE=6
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:rhel-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION
ARG RELEASE
@ -14,13 +15,18 @@ 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}
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-trunk" \
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-trunk:${ZBX_VERSION}" \
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" \
@ -31,7 +37,7 @@ LABEL description="Zabbix agent 2 is deployed on a monitoring target to actively
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-trunk:${ZBX_VERSION}" \
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" \
@ -47,21 +53,22 @@ STOPSIGNAL SIGTERM
COPY ["licenses", "/licenses"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/", "/usr/sbin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/", "/etc/zabbix/"]
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 \
iputils \
shadow-utils \
pcre2 \
smartmontools \
# smartmontools \
sudo \
libcurl-minimal" && \
microdnf -y install \
--disableplugin=subscription-manager \
--disablerepo "*" \
--enablerepo "ubi-9-baseos-rpms" \
--enablerepo "ubi-10-baseos-rpms" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
@ -70,20 +77,20 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
microdnf -y update \
--disableplugin=subscription-manager \
--disablerepo "*" \
--enablerepo "ubi-9-baseos-rpms" \
--enablerepo "ubi-10-baseos-rpms" \
--setopt=install_weak_deps=0 \
--best \
--setopt=tsflags=nodocs \
tzdata && \
microdnf -y reinstall \
--disableplugin=subscription-manager \
--disablerepo "*" \
--enablerepo "ubi-9-baseos-rpms" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--setopt=tsflags=nodocs \
tzdata && \
# microdnf -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 \
@ -94,23 +101,37 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/buffer && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
microdnf -y clean all
mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agent2.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
EXPOSE 10050/TCP 31999/TCP
WORKDIR /var/lib/zabbix
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -0,0 +1,144 @@
# syntax=docker/dockerfile:1
ARG OS_BASE_IMAGE=nvidia/cuda:12.9.0-base-ubi9
ARG MAJOR_VERSION=7.2
ARG RELEASE=7
ARG ZBX_VERSION=${MAJOR_VERSION}.7
ARG BUILD_BASE_IMAGE=registry.connect.redhat.com/zabbix/zabbix-agent2-72:${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-72" \
release="${RELEASE}" \
run="docker run --name zabbix-agent2 --link zabbix-server:zabbix-server -p 10050:10050 -d registry.connect.redhat.com/zabbix/zabbix-agent2-72:${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-72:${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 ["/usr/sbin/zabbix*", "/usr/sbin/"]
COPY --from=builder ["/usr/sbin/zabbix-agent2-plugin/", "/usr/sbin/zabbix-agent2-plugin/"]
COPY --from=builder ["/usr/bin/zabbix*", "/usr/bin/"]
COPY --from=builder ["/etc/zabbix/", "${ZABBIX_CONF_DIR}/"]
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="bash \
iputils \
shadow-utils \
pcre2 \
# smartmontools \
sudo \
libcurl-minimal" && \
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} && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agent2.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
EXPOSE 10050/TCP 31999/TCP
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
USER 1997
CMD ["/usr/sbin/zabbix_agent2", "--foreground", "-c", "/etc/zabbix/zabbix_agent2.conf"]

View File

@ -103,7 +103,7 @@
<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>
<h1 id="user-feedback">User Feedback</h1>
<h2 id="documentation">Documentation</h2>
<p>Documentation for this image is stored in the <a href="https://github.com/zabbix/zabbix-docker/tree/trunk/Dockerfiles/agent2"><code>agent2/</code> directory</a> of the <a href="https://github.com/zabbix/zabbix-docker/"><code>zabbix/zabbix-docker</code> GitHub repo</a>. Be sure to familiarize yourself with the <a href="https://github.com/zabbix/zabbix-docker/blob/trunk/README.md">repository&#39;s <code>README.md</code> file</a> before attempting a pull request.</p>
<p>Documentation for this image is stored in the <a href="https://github.com/zabbix/zabbix-docker/tree/7.4/Dockerfiles/agent2"><code>agent2/</code> directory</a> of the <a href="https://github.com/zabbix/zabbix-docker/"><code>zabbix/zabbix-docker</code> GitHub repo</a>. Be sure to familiarize yourself with the <a href="https://github.com/zabbix/zabbix-docker/blob/7.4/README.md">repository&#39;s <code>README.md</code> file</a> before attempting a pull request.</p>
<h2 id="issues">Issues</h2>
<p>If you have any problems with or questions about this image, please contact us through a <a href="https://github.com/zabbix/zabbix-docker/issues">GitHub issue</a>.</p>
<h3 id="known-issues">Known issues</h3>

View File

@ -11,15 +11,13 @@ fi
# Default Zabbix installation name
# Default Zabbix server host
: ${ZBX_SERVER_HOST:="zabbix-server"}
: ${ZBX_SERVER_HOST="zabbix-server"}
# Default Zabbix server port number
: ${ZBX_SERVER_PORT:="10051"}
: ${ZBX_SERVER_PORT="10051"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
ZABBIX_INTERNAL_ENC_DIR="${ZABBIX_USER_HOME_DIR}/enc_internal"
escape_spec_char() {
local var_value=$1
@ -57,16 +55,20 @@ update_config_var() {
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value
# Remove configuration parameter definition in case of unset or empty parameter value
if [ -z "$var_value" ]; then
sed -i -e "/^$var_name=/d" "$config_path"
echo "removed"
return
fi
# Remove value from configuration parameter in case of double quoted parameter value
if [ "$var_value" == '""' ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
# Remove value from configuration parameter in case of set to double quoted parameter value
if [[ "$var_value" == '""' ]]; then
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
else
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
fi
echo "undefined"
return
fi
@ -80,7 +82,9 @@ update_config_var() {
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
if [ "$(grep -E "^$var_name=$var_value$" $config_path)" ]; then
echo "exists"
elif [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
echo "updated"
elif [ "$(grep -Ec "^# $var_name=" $config_path)" -gt 1 ]; then
@ -112,105 +116,111 @@ update_config_multiple_var() {
done
}
file_process_from_env() {
local var_name=$1
local file_name=$2
local var_value=$3
if [ ! -z "$var_value" ]; then
echo -n "$var_value" > "${ZABBIX_INTERNAL_ENC_DIR}/$var_name"
file_name="${ZABBIX_INTERNAL_ENC_DIR}/${var_name}"
fi
if [ -n "$var_value" ]; then
export "$var_name"="$file_name"
fi
# Remove variable with plain text data
unset "${var_name%%FILE}"
}
prepare_zbx_agent_config() {
echo "** Preparing Zabbix agent configuration file"
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agent2.conf
: ${ZBX_PASSIVESERVERS=""}
: ${ZBX_ACTIVESERVERS=""}
: ${ZBX_PASSIVESERVERS:=""}
: ${ZBX_ACTIVESERVERS:=""}
if [ ! -z "$ZBX_SERVER_HOST" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST","$ZBX_PASSIVESERVERS
elif [ ! -z "$ZBX_SERVER_HOST" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST
fi
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
update_config_var $ZBX_AGENT_CONFIG "PidFile"
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
update_config_var $ZBX_AGENT_CONFIG "LogFile"
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
if [ ! -z "$ZBX_SERVER_HOST" ]; then
if [ ! -z "$ZBX_SERVER_PORT" ] && [ "$ZBX_SERVER_PORT" != "10051" ]; then
ZBX_SERVER_HOST=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT
fi
if [ ! -z "$ZBX_ACTIVESERVERS" ]; then
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST","$ZBX_ACTIVESERVERS
else
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST
fi
fi
: ${ZBX_PASSIVE_ALLOW:="true"}
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
export ZBX_PASSIVESERVERS="${ZBX_PASSIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "Server"
unset ZBX_PASSIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_AGENT_CONFIG "ListenIP" "${ZBX_LISTENIP}"
: ${ZBX_ACTIVE_ALLOW:="true"}
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_ACTIVESERVERS" ]; then
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
export ZBX_ACTIVESERVERS="${ZBX_ACTIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
unset ZBX_ACTIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "HeartbeatFrequency" "${ZBX_HEARTBEAT_FREQUENCY}"
update_config_var $ZBX_AGENT_CONFIG "ForceActiveChecksOnStart" "${ZBX_FORCEACTIVECHECKSONSTART}"
unset ZBX_SERVER_HOST
unset ZBX_SERVER_PORT
if [ "${ZBX_ENABLEPERSISTENTBUFFER,,}" == "true" ]; then
update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "1"
update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/agent2.db"
update_config_var $ZBX_AGENT_CONFIG "PersistentBufferPeriod" "${ZBX_PERSISTENTBUFFERPERIOD}"
export ZBX_ENABLEPERSISTENTBUFFER=1
else
update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "0"
unset ZBX_ENABLEPERSISTENTBUFFER
unset ZBX_PERSISTENTBUFFERFILE
fi
if [ "${ZBX_ENABLESTATUSPORT,,}" == "true" ]; then
update_config_var $ZBX_AGENT_CONFIG "StatusPort" "31999"
export ZBX_STATUSPORT=${ZBX_STATUSPORT="31999"}
else
unset ZBX_STATUSPORT
fi
update_config_var $ZBX_AGENT_CONFIG "HostInterface" "${ZBX_HOSTINTERFACE}"
update_config_var $ZBX_AGENT_CONFIG "HostInterfaceItem" "${ZBX_HOSTINTERFACEITEM}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf" "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf" "AllowKey" "${ZBX_ALLOWKEY}"
update_config_var $ZBX_AGENT_CONFIG "Hostname" "${ZBX_HOSTNAME}"
update_config_var $ZBX_AGENT_CONFIG "HostnameItem" "${ZBX_HOSTNAMEITEM}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadata" "${ZBX_METADATA}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadataItem" "${ZBX_METADATAITEM}"
update_config_var $ZBX_AGENT_CONFIG "RefreshActiveChecks" "${ZBX_REFRESHACTIVECHECKS}"
update_config_var $ZBX_AGENT_CONFIG "BufferSend" "${ZBX_BUFFERSEND}"
update_config_var $ZBX_AGENT_CONFIG "BufferSize" "${ZBX_BUFFERSIZE}"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" "true"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCRLFile" "${ZBX_TLSCRLFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
update_config_multiple_var $ZBX_AGENT_CONFIG "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var $ZBX_AGENT_CONFIG "AllowKey" "${ZBX_ALLOWKEY}"
file_process_from_env "ZBX_TLSCAFILE" "${ZBX_TLSCAFILE}" "${ZBX_TLSCA}"
file_process_from_env "ZBX_TLSCRLFILE" "${ZBX_TLSCRLFILE}" "${ZBX_TLSCRL}"
file_process_from_env "ZBX_TLSCERTFILE" "${ZBX_TLSCERTFILE}" "${ZBX_TLSCERT}"
file_process_from_env "ZBX_TLSKEYFILE" "${ZBX_TLSKEYFILE}" "${ZBX_TLSKEY}"
file_process_from_env "ZBX_TLSPSKFILE" "${ZBX_TLSPSKFILE}" "${ZBX_TLSPSK}"
}
prepare_zbx_agent_plugin_config() {
echo "** Preparing Zabbix agent plugin configuration files"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
if command -v nvidia-smi 2>&1 >/dev/null
then
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu"
fi
}
clear_zbx_env() {
[[ "${ZBX_CLEAR_ENV}" == "false" ]] && return
for env_var in $(env | grep -E "^ZABBIX_"); do
unset "${env_var%%=*}"
done
}
prepare_agent() {
echo "** Preparing Zabbix agent"
prepare_zbx_agent_config
prepare_zbx_agent_plugin_config
clear_zbx_env
}
#################################################

View File

@ -1,18 +1,24 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=ubuntu:noble
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-mysql:ubuntu-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
FROM ubuntu:noble
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}
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" \
@ -28,12 +34,15 @@ STOPSIGNAL SIGTERM
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/sbin/", "/usr/sbin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/general/bin/*", "/usr/bin/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/", "/etc/zabbix/"]
COPY --from=builder ["/tmp/zabbix-${ZBX_VERSION}-output/agent2/conf/", "${ZABBIX_CONF_DIR}/"]
RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--mount=type=cache,target=/var/lib/apt/,sharing=locked \
set -eux && \
echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d && \
INSTALL_PKGS="tzdata \
INSTALL_PKGS="bash \
tzdata \
iputils-ping \
ca-certificates \
smartmontools \
sudo \
@ -55,24 +64,37 @@ RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
-g zabbix \
--uid 1997 \
--shell /sbin/nologin \
--home-dir /var/lib/zabbix/ \
--home-dir ${ZABBIX_USER_HOME_DIR} \
zabbix && \
echo "zabbix ALL=(root) NOPASSWD: /usr/sbin/smartctl" >> /etc/sudoers.d/zabbix && \
mkdir -p /etc/zabbix && \
mkdir -p /etc/zabbix/zabbix_agentd.d && \
mkdir -p /var/lib/zabbix && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/buffer && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
apt-get -y autoremove && \
apt-get -y clean
mkdir -p ${ZABBIX_CONF_DIR} && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agentd.d && \
mkdir -p ${ZABBIX_CONF_DIR}/zabbix_agent2.d && \
mkdir -p ${ZABBIX_USER_HOME_DIR} && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/enc_internal && \
mkdir -p ${ZABBIX_USER_HOME_DIR}/buffer && \
mkdir -p ${ZBX_USERPARAMETERDIR} && \
chown --quiet -R zabbix:root ${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 zabbix:root ${ZABBIX_CONF_DIR}/ && \
chgrp -R 0 ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chgrp 0 ${ZABBIX_CONF_DIR} && \
chmod -R g=u ${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf \
${ZABBIX_CONF_DIR}/zabbix_agentd.d/ \
${ZABBIX_CONF_DIR}/zabbix_agent2.d/ \
${ZABBIX_USER_HOME_DIR}/ && \
chmod g=u ${ZABBIX_CONF_DIR} && \
/usr/sbin/zabbix_agent2 -V
EXPOSE 10050/TCP
EXPOSE 10050/TCP 31999/TCP
WORKDIR /var/lib/zabbix
WORKDIR ${ZABBIX_USER_HOME_DIR}
COPY ["docker-entrypoint.sh", "/usr/bin/"]

View File

@ -11,15 +11,13 @@ fi
# Default Zabbix installation name
# Default Zabbix server host
: ${ZBX_SERVER_HOST:="zabbix-server"}
: ${ZBX_SERVER_HOST="zabbix-server"}
# Default Zabbix server port number
: ${ZBX_SERVER_PORT:="10051"}
: ${ZBX_SERVER_PORT="10051"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
ZABBIX_INTERNAL_ENC_DIR="${ZABBIX_USER_HOME_DIR}/enc_internal"
escape_spec_char() {
local var_value=$1
@ -57,16 +55,20 @@ update_config_var() {
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value
# Remove configuration parameter definition in case of unset or empty parameter value
if [ -z "$var_value" ]; then
sed -i -e "/^$var_name=/d" "$config_path"
echo "removed"
return
fi
# Remove value from configuration parameter in case of double quoted parameter value
if [ "$var_value" == '""' ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
# Remove value from configuration parameter in case of set to double quoted parameter value
if [[ "$var_value" == '""' ]]; then
if [ "$(grep -E "^$var_name=" $config_path)" ]; then
sed -i -e "/^$var_name=/s/=.*/=/" "$config_path"
else
sed -i -e "/^[#;] $var_name=/s/.*/&\n$var_name=/" "$config_path"
fi
echo "undefined"
return
fi
@ -80,7 +82,9 @@ update_config_var() {
var_value=$(escape_spec_char "$var_value")
var_name=$(escape_spec_char "$var_name")
if [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
if [ "$(grep -E "^$var_name=$var_value$" $config_path)" ]; then
echo "exists"
elif [ "$(grep -E "^$var_name=" $config_path)" ] && [ "$is_multiple" != "true" ]; then
sed -i -e "/^$var_name=/s/=.*/=$var_value/" "$config_path"
echo "updated"
elif [ "$(grep -Ec "^# $var_name=" $config_path)" -gt 1 ]; then
@ -112,105 +116,111 @@ update_config_multiple_var() {
done
}
file_process_from_env() {
local var_name=$1
local file_name=$2
local var_value=$3
if [ ! -z "$var_value" ]; then
echo -n "$var_value" > "${ZABBIX_INTERNAL_ENC_DIR}/$var_name"
file_name="${ZABBIX_INTERNAL_ENC_DIR}/${var_name}"
fi
if [ -n "$var_value" ]; then
export "$var_name"="$file_name"
fi
# Remove variable with plain text data
unset "${var_name%%FILE}"
}
prepare_zbx_agent_config() {
echo "** Preparing Zabbix agent configuration file"
ZBX_AGENT_CONFIG=$ZABBIX_ETC_DIR/zabbix_agent2.conf
: ${ZBX_PASSIVESERVERS=""}
: ${ZBX_ACTIVESERVERS=""}
: ${ZBX_PASSIVESERVERS:=""}
: ${ZBX_ACTIVESERVERS:=""}
if [ ! -z "$ZBX_SERVER_HOST" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST","$ZBX_PASSIVESERVERS
elif [ ! -z "$ZBX_SERVER_HOST" ]; then
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST
fi
[ -n "$ZBX_PASSIVESERVERS" ] && ZBX_PASSIVESERVERS=","$ZBX_PASSIVESERVERS
ZBX_PASSIVESERVERS=$ZBX_SERVER_HOST$ZBX_PASSIVESERVERS
[ -n "$ZBX_ACTIVESERVERS" ] && ZBX_ACTIVESERVERS=","$ZBX_ACTIVESERVERS
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT$ZBX_ACTIVESERVERS
update_config_var $ZBX_AGENT_CONFIG "PidFile"
update_config_var $ZBX_AGENT_CONFIG "LogType" "console"
update_config_var $ZBX_AGENT_CONFIG "LogFile"
update_config_var $ZBX_AGENT_CONFIG "LogFileSize"
update_config_var $ZBX_AGENT_CONFIG "DebugLevel" "${ZBX_DEBUGLEVEL}"
update_config_var $ZBX_AGENT_CONFIG "SourceIP"
if [ ! -z "$ZBX_SERVER_HOST" ]; then
if [ ! -z "$ZBX_SERVER_PORT" ] && [ "$ZBX_SERVER_PORT" != "10051" ]; then
ZBX_SERVER_HOST=$ZBX_SERVER_HOST":"$ZBX_SERVER_PORT
fi
if [ ! -z "$ZBX_ACTIVESERVERS" ]; then
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST","$ZBX_ACTIVESERVERS
else
ZBX_ACTIVESERVERS=$ZBX_SERVER_HOST
fi
fi
: ${ZBX_PASSIVE_ALLOW:="true"}
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_PASSIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_PASSIVESERVERS" ]; then
echo "** Using '$ZBX_PASSIVESERVERS' servers for passive checks"
update_config_var $ZBX_AGENT_CONFIG "Server" "${ZBX_PASSIVESERVERS}"
export ZBX_PASSIVESERVERS="${ZBX_PASSIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "Server"
unset ZBX_PASSIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "ListenPort" "${ZBX_LISTENPORT}"
update_config_var $ZBX_AGENT_CONFIG "ListenIP" "${ZBX_LISTENIP}"
: ${ZBX_ACTIVE_ALLOW:="true"}
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ]; then
if [ "${ZBX_ACTIVE_ALLOW,,}" == "true" ] && [ ! -z "$ZBX_ACTIVESERVERS" ]; then
echo "** Using '$ZBX_ACTIVESERVERS' servers for active checks"
update_config_var $ZBX_AGENT_CONFIG "ServerActive" "${ZBX_ACTIVESERVERS}"
export ZBX_ACTIVESERVERS="${ZBX_ACTIVESERVERS}"
else
update_config_var $ZBX_AGENT_CONFIG "ServerActive"
unset ZBX_ACTIVESERVERS
fi
update_config_var $ZBX_AGENT_CONFIG "HeartbeatFrequency" "${ZBX_HEARTBEAT_FREQUENCY}"
update_config_var $ZBX_AGENT_CONFIG "ForceActiveChecksOnStart" "${ZBX_FORCEACTIVECHECKSONSTART}"
unset ZBX_SERVER_HOST
unset ZBX_SERVER_PORT
if [ "${ZBX_ENABLEPERSISTENTBUFFER,,}" == "true" ]; then
update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "1"
update_config_var $ZBX_AGENT_CONFIG "PersistentBufferFile" "$ZABBIX_USER_HOME_DIR/buffer/agent2.db"
update_config_var $ZBX_AGENT_CONFIG "PersistentBufferPeriod" "${ZBX_PERSISTENTBUFFERPERIOD}"
export ZBX_ENABLEPERSISTENTBUFFER=1
else
update_config_var $ZBX_AGENT_CONFIG "EnablePersistentBuffer" "0"
unset ZBX_ENABLEPERSISTENTBUFFER
unset ZBX_PERSISTENTBUFFERFILE
fi
if [ "${ZBX_ENABLESTATUSPORT,,}" == "true" ]; then
update_config_var $ZBX_AGENT_CONFIG "StatusPort" "31999"
export ZBX_STATUSPORT=${ZBX_STATUSPORT="31999"}
else
unset ZBX_STATUSPORT
fi
update_config_var $ZBX_AGENT_CONFIG "HostInterface" "${ZBX_HOSTINTERFACE}"
update_config_var $ZBX_AGENT_CONFIG "HostInterfaceItem" "${ZBX_HOSTINTERFACEITEM}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf" "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var "${ZABBIX_CONF_DIR}/zabbix_agent2_item_keys.conf" "AllowKey" "${ZBX_ALLOWKEY}"
update_config_var $ZBX_AGENT_CONFIG "Hostname" "${ZBX_HOSTNAME}"
update_config_var $ZBX_AGENT_CONFIG "HostnameItem" "${ZBX_HOSTNAMEITEM}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadata" "${ZBX_METADATA}"
update_config_var $ZBX_AGENT_CONFIG "HostMetadataItem" "${ZBX_METADATAITEM}"
update_config_var $ZBX_AGENT_CONFIG "RefreshActiveChecks" "${ZBX_REFRESHACTIVECHECKS}"
update_config_var $ZBX_AGENT_CONFIG "BufferSend" "${ZBX_BUFFERSEND}"
update_config_var $ZBX_AGENT_CONFIG "BufferSize" "${ZBX_BUFFERSIZE}"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" "true"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCAFile" "${ZBX_TLSCAFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSCRLFile" "${ZBX_TLSCRLFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertIssuer" "${ZBX_TLSSERVERCERTISSUER}"
update_config_var $ZBX_AGENT_CONFIG "TLSServerCertSubject" "${ZBX_TLSSERVERCERTSUBJECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSCertFile" "${ZBX_TLSCERTFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSKeyFile" "${ZBX_TLSKEYFILE}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_AGENT_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
update_config_multiple_var $ZBX_AGENT_CONFIG "DenyKey" "${ZBX_DENYKEY}"
update_config_multiple_var $ZBX_AGENT_CONFIG "AllowKey" "${ZBX_ALLOWKEY}"
file_process_from_env "ZBX_TLSCAFILE" "${ZBX_TLSCAFILE}" "${ZBX_TLSCA}"
file_process_from_env "ZBX_TLSCRLFILE" "${ZBX_TLSCRLFILE}" "${ZBX_TLSCRL}"
file_process_from_env "ZBX_TLSCERTFILE" "${ZBX_TLSCERTFILE}" "${ZBX_TLSCERT}"
file_process_from_env "ZBX_TLSKEYFILE" "${ZBX_TLSKEYFILE}" "${ZBX_TLSKEY}"
file_process_from_env "ZBX_TLSPSKFILE" "${ZBX_TLSPSKFILE}" "${ZBX_TLSPSK}"
}
prepare_zbx_agent_plugin_config() {
echo "** Preparing Zabbix agent plugin configuration files"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "/etc/zabbix/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mongodb.conf" "Plugins.MongoDB.System.Path" "/usr/sbin/zabbix-agent2-plugin/mongodb"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/postgresql.conf" "Plugins.PostgreSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/postgresql"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/mssql.conf" "Plugins.MSSQL.System.Path" "/usr/sbin/zabbix-agent2-plugin/mssql"
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/ember.conf" "Plugins.EmberPlus.System.Path" "/usr/sbin/zabbix-agent2-plugin/ember-plus"
if command -v nvidia-smi 2>&1 >/dev/null
then
update_config_var "${ZABBIX_CONF_DIR}/zabbix_agent2.d/plugins.d/nvidia.conf" "Plugins.NVIDIA.System.Path" "/usr/sbin/zabbix-agent2-plugin/nvidia-gpu"
fi
}
clear_zbx_env() {
[[ "${ZBX_CLEAR_ENV}" == "false" ]] && return
for env_var in $(env | grep -E "^ZABBIX_"); do
unset "${env_var%%=*}"
done
}
prepare_agent() {
echo "** Preparing Zabbix agent"
prepare_zbx_agent_config
prepare_zbx_agent_plugin_config
clear_zbx_env
}
#################################################

View File

@ -1,19 +1,25 @@
# syntax=docker/dockerfile:1
# escape=`
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG OS_BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:ltsc2022
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent2-${ZBX_VERSION}
ARG BASE_IMAGE=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022
FROM ${BUILD_BASE_IMAGE} AS builder
FROM $BASE_IMAGE
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" `
@ -24,37 +30,42 @@ LABEL org.opencontainers.image.title="Zabbix agent 2" `
org.opencontainers.image.version="${ZBX_VERSION}" `
org.opencontainers.image.source="${ZBX_SOURCES}"
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';"]
COPY --from=builder ["C:\\zabbix-${ZBX_VERSION}-output", "C:\\zabbix"]
COPY --from=builder ["C:\\build_deps\\pwsh", "C:\\Program Files\\PowerShell"]
COPY [".\\docker-entrypoint.ps1", "C:\\zabbix"]
WORKDIR C:\zabbix\
COPY --from=builder ["C:\\zabbix-${ZBX_VERSION}-output", "C:\\zabbix"]
COPY [".\\docker-entrypoint.ps1", "C:\\zabbix"]
USER ContainerAdministrator
RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell"
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';"]
RUN $env:PATH = [string]::Format('{0}\zabbix\sbin;{0}\zabbix\bin;', $env:SystemDrive) + $env:PATH; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
$env:ZBX_HOME = [string]::Format('{0}\zabbix', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('ZBX_HOME', $env:ZBX_HOME, [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:ZBX_HOME\conf\zabbix_agentd.d | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_HOME\enc | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_HOME\modules | Out-Null; `
New-Item -Force -ItemType directory -Path $env:ZBX_HOME\buffer | Out-Null; `
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:ZBX_HOME; `
$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:ZBX_HOME;
Set-Acl -AclObject $acl -Path $env:ZABBIX_USER_HOME_DIR;
USER zabbix

View File

@ -4,22 +4,18 @@ if ($env:DEBUG_MODE -eq "true") {
Set-PSDebug -trace 1
}
# Default Zabbix installation name
# Default Zabbix server host
if ([string]::IsNullOrWhitespace($env:ZBX_SERVER_HOST)) {
if ($env:ZBX_SERVER_HOST -eq $null) {
$env:ZBX_SERVER_HOST="zabbix-server"
}
# Default Zabbix server port number
if ([string]::IsNullOrWhitespace($env:ZBX_SERVER_PORT)) {
if ($env:ZBX_SERVER_PORT -eq $null) {
$env:ZBX_SERVER_PORT="10051"
}
# Default directories
# User 'zabbix' home directory
$ZabbixUserHomeDir="C:\zabbix"
# Configuration files directory
$ZabbixConfigDir="C:\zabbix\conf"
# Internal directory for TLS related files, used when TLS*File specified as plain text values
$ZabbixInternalEncDir="$env:ZABBIX_USER_HOME_DIR/enc_internal"
function Update-Config-Var {
Param (
@ -66,7 +62,7 @@ function Update-Config-Var {
}
if ($VarName -match '^TLS.*File$') {
$VarValue="$ZabbixUserHomeDir\enc\$VarValue"
$VarValue="$env:ZABBIX_USER_HOME_DIR\enc\$VarValue"
}
if ((Get-Content $ConfigPath | %{$_ -match "^$VarName="}) -contains $true -And $IsMultiple -ne $true) {
@ -97,7 +93,7 @@ function Update-Config-Var {
Write-Host "added"
}
else {
Add-Content -Path $ConfigPath -Value "$VarName=$VarValue"
Add-Content -Path $ConfigPath -Value "$VarName=$VarValue"
Write-Host "added at the end"
}
}
@ -119,75 +115,91 @@ function Update-Config-Multiple-Var {
}
}
function File-Process-From-Env {
Param (
[Parameter(Mandatory=$true, Position=0)]
[ValidateNotNullOrEmpty()]
[string] $VarName,
[Parameter(Mandatory=$false, Position=1)]
[string]$FileName = $null,
[Parameter(Mandatory=$false, Position=2)]
[string]$VarValue = $null
)
if (![string]::IsNullOrEmpty($VarValue)) {
$VarValue | Set-Content "$ZabbixInternalEncDir\$VarName"
$FileName="$ZabbixInternalEncDir\$VarName"
}
if (![string]::IsNullOrEmpty($FileName)) {
Set-Item env:$VarName -Value $FileName
}
$VarName=$VarName -replace 'FILE$'
Set-Item env:$VarName -Value $null
}
function Prepare-Zbx-Agent-Config {
Write-Host "** Preparing Zabbix agent 2 configuration file"
$ZbxAgentConfig="$ZabbixConfigDir\zabbix_agent2.conf"
if ([string]::IsNullOrWhitespace($env:ZBX_PASSIVESERVERS)) {
if ($env:ZBX_PASSIVESERVERS -eq $null) {
$env:ZBX_PASSIVESERVERS=""
}
else {
$env:ZBX_PASSIVESERVERS=",$env:ZBX_PASSIVESERVERS"
}
$env:ZBX_PASSIVESERVERS=$env:ZBX_SERVER_HOST + $env:ZBX_PASSIVESERVERS
if ([string]::IsNullOrWhitespace($env:ZBX_ACTIVESERVERS)) {
if ($env:ZBX_ACTIVESERVERS -eq $null) {
$env:ZBX_ACTIVESERVERS=""
}
else {
$env:ZBX_ACTIVESERVERS=",$env:ZBX_ACTIVESERVERS"
if (![string]::IsNullOrEmpty($env:ZBX_SERVER_HOST) -And ![string]::IsNullOrEmpty($env:ZBX_PASSIVESERVERS)) {
$env:ZBX_PASSIVESERVERS="$env:ZBX_SERVER_HOST,$env:ZBX_PASSIVESERVERS"
}
elseif (![string]::IsNullOrEmpty($env:ZBX_SERVER_HOST)) {
$env:ZBX_PASSIVESERVERS=$env:ZBX_SERVER_HOST
}
$env:ZBX_ACTIVESERVERS=$env:ZBX_SERVER_HOST + ":" + $env:ZBX_SERVER_PORT + $env:ZBX_ACTIVESERVERS
Update-Config-Var $ZbxAgentConfig "LogType" "console"
Update-Config-Var $ZbxAgentConfig "LogFile"
Update-Config-Var $ZbxAgentConfig "LogFileSize"
Update-Config-Var $ZbxAgentConfig "DebugLevel" "$env:ZBX_DEBUGLEVEL"
Update-Config-Var $ZbxAgentConfig "SourceIP"
if (![string]::IsNullOrEmpty($env:ZBX_SERVER_HOST)) {
if (![string]::IsNullOrEmpty($env:ZBX_SERVER_PORT) -And $env:ZBX_SERVER_PORT -ne "10051") {
$env:ZBX_SERVER_HOST="$env:ZBX_SERVER_HOST:$env:ZBX_SERVER_PORT"
}
if (![string]::IsNullOrEmpty($env:ZBX_ACTIVESERVERS)) {
$env:ZBX_ACTIVESERVERS="$env:ZBX_SERVER_HOST,$env:ZBX_ACTIVESERVERS"
}
else {
$env:ZBX_ACTIVESERVERS=$env:ZBX_SERVER_HOST
}
}
if ([string]::IsNullOrWhitespace($env:ZBX_PASSIVE_ALLOW)) {
$env:ZBX_PASSIVE_ALLOW="true"
}
if ($env:ZBX_PASSIVE_ALLOW -eq "true") {
Write-Host "** Using '$env:ZBX_PASSIVESERVERS' servers for passive checks"
Update-Config-Var $ZbxAgentConfig "Server" "$env:ZBX_PASSIVESERVERS"
Write-Host "** Using '$env:ZBX_PASSIVESERVERS' servers for passive checks"
}
else {
Update-Config-Var $ZbxAgentConfig "Server"
Set-Item env:ZBX_PASSIVESERVERS -Value $null
}
Update-Config-Var $ZbxAgentConfig "ListenPort" "$env:ZBX_LISTENPORT"
Update-Config-Var $ZbxAgentConfig "ListenIP" "$env:ZBX_LISTENIP"
if ([string]::IsNullOrWhitespace($env:ZBX_ACTIVE_ALLOW)) {
$env:ZBX_ACTIVE_ALLOW="true"
}
if ($env:ZBX_PASSIVE_ALLOW -eq "true") {
if ($env:ZBX_ACTIVE_ALLOW -eq "true") {
Write-Host "** Using '$env:ZBX_ACTIVESERVERS' servers for active checks"
Update-Config-Var $ZbxAgentConfig "ServerActive" "$env:ZBX_ACTIVESERVERS"
}
else {
Update-Config-Var $ZbxAgentConfig "ServerActive"
Set-Item env:ZBX_ACTIVESERVERS -Value $null
}
Update-Config-Var $ZbxAgentConfig "HeartbeatFrequency" "$env:ZBX_HEARTBEAT_FREQUENCY"
Update-Config-Var $ZbxAgentConfig "ForceActiveChecksOnStart" "$env:ZBX_FORCEACTIVECHECKSONSTART"
Set-Item env:ZBX_SERVER_HOST -Value $null
Set-Item env:ZBX_SERVER_PORT -Value $null
if ([string]::IsNullOrWhitespace($env:ZBX_ENABLEPERSISTENTBUFFER)) {
$env:ZBX_ENABLEPERSISTENTBUFFER="true"
}
if ($env:ZBX_ENABLEPERSISTENTBUFFER -eq "true") {
Update-Config-Var $ZbxAgentConfig "EnablePersistentBuffer" "1"
Update-Config-Var $ZbxAgentConfig "PersistentBufferFile" "$ZabbixUserHomeDir\buffer\agent2.db"
Update-Config-Var $ZbxAgentConfig "PersistentBufferPeriod" "$env:ZBX_PERSISTENTBUFFERPERIOD"
$env:ZBX_ENABLEPERSISTENTBUFFER="1"
}
else {
Update-Config-Var $ZbxAgentConfig "EnablePersistentBuffer" "0"
Set-Item env:ZBX_ENABLEPERSISTENTBUFFER -Value $null
Set-Item env:ZBX_PERSISTENTBUFFERFILE -Value $null
}
if ([string]::IsNullOrWhitespace($env:ZBX_ENABLESTATUSPORT)) {
@ -195,62 +207,48 @@ function Prepare-Zbx-Agent-Config {
}
if ($env:ZBX_ENABLESTATUSPORT -eq "true") {
Update-Config-Var $ZbxAgentConfig "StatusPort" "31999"
$env:ZBX_STATUSPORT="31999"
}
Update-Config-Var $ZbxAgentConfig "Hostname" "$env:ZBX_HOSTNAME"
Update-Config-Var $ZbxAgentConfig "HostnameItem" "$env:ZBX_HOSTNAMEITEM"
Update-Config-Var $ZbxAgentConfig "HostMetadata" "$env:ZBX_METADATA"
Update-Config-Var $ZbxAgentConfig "HostMetadataItem" "$env:ZBX_METADATAITEM"
Update-Config-Var $ZbxAgentConfig "HostInterface" "$env:ZBX_HOSTINTERFACE"
Update-Config-Var $ZbxAgentConfig "HostInterfaceItem" "$env:ZBX_HOSTINTERFACEITEM"
Update-Config-Var $ZbxAgentConfig "RefreshActiveChecks" "$env:ZBX_REFRESHACTIVECHECKS"
Update-Config-Var $ZbxAgentConfig "BufferSend" "$env:ZBX_BUFFERSEND"
Update-Config-Var $ZbxAgentConfig "BufferSize" "$env:ZBX_BUFFERSIZE"
# Please use include to enable Alias feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" $env:ZBX_ALIAS
# Please use include to enable Perfcounter feature
# update_config_multiple_var $ZBX_AGENT_CONFIG "PerfCounter" $env:ZBX_PERFCOUNTER
Update-Config-Var $ZbxAgentConfig "Timeout" "$env:ZBX_TIMEOUT"
Update-Config-Var $ZbxAgentConfig "Include" ".\zabbix_agent2.d\plugins.d\*.conf"
Update-Config-Var $ZbxAgentConfig "Include" ".\zabbix_agentd.d\*.conf" $true
Update-Config-Var $ZbxAgentConfig "UnsafeUserParameters" "$env:ZBX_UNSAFEUSERPARAMETERS"
Update-Config-Var $ZbxAgentConfig "UserParameterDir" "$ZabbixUserHomeDir\user_scripts\"
Update-Config-Var $ZbxAgentConfig "TLSConnect" "$env:ZBX_TLSCONNECT"
Update-Config-Var $ZbxAgentConfig "TLSAccept" "$env:ZBX_TLSACCEPT"
Update-Config-Var $ZbxAgentConfig "TLSCAFile" "$env:ZBX_TLSCAFILE"
Update-Config-Var $ZbxAgentConfig "TLSCRLFile" "$env:ZBX_TLSCRLFILE"
Update-Config-Var $ZbxAgentConfig "TLSServerCertIssuer" "$env:ZBX_TLSSERVERCERTISSUER"
Update-Config-Var $ZbxAgentConfig "TLSServerCertSubject" "$env:ZBX_TLSSERVERCERTSUBJECT"
Update-Config-Var $ZbxAgentConfig "TLSCertFile" "$env:ZBX_TLSCERTFILE"
Update-Config-Var $ZbxAgentConfig "TLSCipherAll" "$env:ZBX_TLSCIPHERALL"
Update-Config-Var $ZbxAgentConfig "TLSCipherAll13" "$env:ZBX_TLSCIPHERALL13"
Update-Config-Var $ZbxAgentConfig "TLSCipherCert" "$env:ZBX_TLSCIPHERCERT"
Update-Config-Var $ZbxAgentConfig "TLSCipherCert13" "$env:ZBX_TLSCIPHERCERT13"
Update-Config-Var $ZbxAgentConfig "TLSCipherPSK" "$env:ZBX_TLSCIPHERPSK"
Update-Config-Var $ZbxAgentConfig "TLSCipherPSK13" "$env:ZBX_TLSCIPHERPSK13"
Update-Config-Var $ZbxAgentConfig "TLSKeyFile" "$env:ZBX_TLSKEYFILE"
Update-Config-Var $ZbxAgentConfig "TLSPSKIdentity" "$env:ZBX_TLSPSKIDENTITY"
Update-Config-Var $ZbxAgentConfig "TLSPSKFile" "$env:ZBX_TLSPSKFILE"
Update-Config-Multiple-Var $ZbxAgentConfig "DenyKey" "$env:ZBX_DENYKEY"
Update-Config-Multiple-Var $ZbxAgentConfig "AllowKey" "$env:ZBX_ALLOWKEY"
Update-Config-Multiple-Var "$env:ZABBIX_CONF_DIR\zabbix_agent2_item_keys.conf" "DenyKey" "$env:ZBX_DENYKEY"
Update-Config-Multiple-Var "$env:ZABBIX_CONF_DIR\zabbix_agent2_item_keys.conf" "AllowKey" "$env:ZBX_ALLOWKEY"
File-Process-From-Env "ZBX_TLSCAFILE" "$env:ZBX_TLSCAFILE" "$env:ZBX_TLSCA"
File-Process-From-Env "ZBX_TLSCRLFILE" "$env:ZBX_TLSCRLFILE" "$env:ZBX_TLSCRL"
File-Process-From-Env "ZBX_TLSCERTFILE" "$env:ZBX_TLSCERTFILE" "$env:ZBX_TLSCERT"
File-Process-From-Env "ZBX_TLSKEYFILE" "$env:ZBX_TLSKEYFILE" "$env:ZBX_TLSKEY"
File-Process-From-Env "ZBX_TLSPSKFILE" "$env:ZBX_TLSPSKFILE" "$env:ZBX_TLSPSK"
}
function Prepare-Zbx-Agent-Plugins-Config {
Write-Host "** Preparing Zabbix agent 2 (plugins) configuration files"
Update-Config-Var "$ZabbixConfigDir\zabbix_agent2.d\plugins.d\mongodb.conf" "Plugins.MongoDB.System.Path" "$ZabbixUserHomeDir\zabbix-agent2-plugin\mongodb.exe"
Update-Config-Var "$ZabbixConfigDir\zabbix_agent2.d\plugins.d\postgresql.conf" "Plugins.PostgreSQL.System.Path" "$ZabbixUserHomeDir\zabbix-agent2-plugin\postgresql.exe"
Update-Config-Var "$ZabbixConfigDir\zabbix_agent2.d\plugins.d\mssql.conf" "Plugins.MSSQL.System.Path" "$ZabbixUserHomeDir\zabbix-agent2-plugin\mssql.exe"
Update-Config-Var "$ZabbixConfigDir\zabbix_agent2.d\plugins.d\ember.conf" "Plugins.EmberPlus.System.Path" "$ZabbixUserHomeDir\zabbix-agent2-plugin\ember-plus.exe"
Update-Config-Var "$env:ZABBIX_CONF_DIR\zabbix_agent2.d\plugins.d\mongodb.conf" "Plugins.MongoDB.System.Path" "$env:ZABBIX_USER_HOME_DIR\zabbix-agent2-plugin\mongodb.exe"
Update-Config-Var "$env:ZABBIX_CONF_DIR\zabbix_agent2.d\plugins.d\postgresql.conf" "Plugins.PostgreSQL.System.Path" "$env:ZABBIX_USER_HOME_DIR\zabbix-agent2-plugin\postgresql.exe"
Update-Config-Var "$env:ZABBIX_CONF_DIR\zabbix_agent2.d\plugins.d\mssql.conf" "Plugins.MSSQL.System.Path" "$env:ZABBIX_USER_HOME_DIR\zabbix-agent2-plugin\mssql.exe"
Update-Config-Var "$env:ZABBIX_CONF_DIR\zabbix_agent2.d\plugins.d\ember.conf" "Plugins.EmberPlus.System.Path" "$env:ZABBIX_USER_HOME_DIR\zabbix-agent2-plugin\ember-plus.exe"
if (Get-Command nvidia-smi.exe -errorAction SilentlyContinue) {
Update-Config-Var "$env:ZABBIX_CONF_DIR\zabbix_agent2.d\plugins.d\nvidia.conf" "Plugins.NVIDIA.System.Path" "$env:ZABBIX_USER_HOME_DIR\zabbix-agent2-plugin\nvidia-gpu.exe"
}
}
function ClearZbxEnv() {
if ([string]::IsNullOrWhitespace($env:ZBX_CLEAR_ENV)) {
return
}
$env_vars=Get-ChildItem env:* | Where-Object {$_.Name -match "^ZABBIX_.*" } | foreach { $_.Name }
foreach ($env_var in $env_vars) {
Set-Item env:$env_var -Value $null
}
}
function PrepareAgent {
Write-Host "** Preparing Zabbix agent 2"
Prepare-Zbx-Agent-Config
Prepare-Zbx-Agent-Plugins-Config
ClearZbxEnv
}
$commandArgs=$args

View File

@ -14,21 +14,23 @@ Zabbix build base image is prepared build environment for building Zabbix compon
# Zabbix build base images
These are the only official Zabbix build base Docker images. They are based on Alpine Linux v3.20, Ubuntu 24.04 (noble), CentOS Stream 9 and Oracle Linux 9 images. The available versions of the image are:
These are the only official Zabbix build base Docker images. They are based on Alpine Linux v3.23, Ubuntu 24.04 (noble), CentOS Stream 10 and Oracle Linux 10 images. The available versions of the image are:
Zabbix build base 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, ol-5.0-latest)
Zabbix build base 5.0.* (tags: alpine-5.0.*, ubuntu-5.0.*, ol-5.0.*)
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 6.4 (tags: alpine-6.4-latest, ubuntu-6.4-latest, ol-6.4-latest, alpine-latest, ubuntu-latest, ol-latest, latest)
Zabbix build base 6.4.* (tags: alpine-6.4.*, ubuntu-6.4.*, ol-6.4.*, ltsc2019-6.4.*, ltsc2022-6.4.*)
Zabbix build base 7.0 (tags: alpine-trunk, ubuntu-trunk, ol-trunk, ltsc2019-trunk, ltsc2022-trunk)
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/trunk/Dockerfiles/build-mysql), [PostgreSQL](https://github.com/zabbix/zabbix-docker/tree/trunk/Dockerfiles/build-pgsql) and [SQLite3](https://github.com/zabbix/zabbix-docker/tree/trunk/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 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
@ -62,7 +64,7 @@ Please see [the Docker installation documentation](https://docs.docker.com/insta
## Documentation
Documentation for this image is stored in the [`build-base/` directory](https://github.com/zabbix/zabbix-docker/tree/trunk/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/master/README.md) before attempting a pull request.
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/master/README.md) before attempting a pull request.
## Issues

View File

@ -1,8 +1,9 @@
# syntax=docker/dockerfile:1
FROM alpine:3.20
ARG OS_BASE_IMAGE=alpine:3.23
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
@ -21,14 +22,15 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
RUN set -eux && \
ARCH_SUFFIX="$(cat /etc/apk/arch)"; \
case "$ARCH_SUFFIX" in \
ppc64le) \
openjdk_packages='openjdk11 openjdk11-jre-headless'; \
riscv64) \
openjdk_packages='openjdk21 openjdk21-jre-headless'; \
;; \
*) openjdk_packages='openjdk17 openjdk17-jre-headless'; \
esac; \
INSTALL_PKGS="bash \
autoconf \
automake \
c-ares-dev \
coreutils \
curl \
curl-dev \

View File

@ -1,8 +1,9 @@
# syntax=docker/dockerfile:1
FROM quay.io/centos/centos:stream9-minimal
ARG OS_BASE_IMAGE=quay.io/centos/centos:stream10-minimal
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
@ -19,29 +20,31 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
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="autoconf \
automake \
bash \
gcc \
patch \
c-ares-devel \
pcre2-devel \
libcurl-devel \
libevent-devel \
libssh-devel \
libmodbus-devel \
# libmodbus-devel \
libxml2-devel \
openssl-devel \
openldap-devel \
make \
mysql-devel \
mysql8.4-devel \
net-snmp-devel \
OpenIPMI-devel \
openldap-devel \
sqlite-devel \
postgresql-private-devel \
postgresql-server-devel \
java-17-openjdk-devel \
java-21-openjdk-devel \
git \
gettext \
go-toolset \
@ -54,12 +57,6 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--setopt=keepcache=0 \
--best \
--nodocs epel-release && \
microdnf -y module enable \
--disablerepo "*" \
--enablerepo "appstream" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
postgresql:16 && \
microdnf -y install \
--disablerepo "*" \
--enablerepo "baseos" \
@ -69,5 +66,4 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs ${INSTALL_PKGS} && \
microdnf -y clean all
--nodocs ${INSTALL_PKGS}

View File

@ -1,8 +1,9 @@
# syntax=docker/dockerfile:1
FROM oraclelinux:9-slim
ARG OS_BASE_IMAGE=container-registry.oracle.com/os/oraclelinux:10-slim
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
@ -17,9 +18,10 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
COPY ["conf/etc/yum.repos.d/oracle-epel-ol9.repo", "/etc/yum.repos.d/oracle-epel-ol9.repo"]
COPY ["conf/etc/yum.repos.d/oracle-epel-ol10.repo", "/etc/yum.repos.d/oracle-epel-ol10.repo"]
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
set -eux && \
INSTALL_PKGS="autoconf \
automake \
@ -27,41 +29,35 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
gcc \
go-toolset \
patch \
c-ares-devel \
pcre2-devel \
libcurl-devel \
libevent-devel \
libssh-devel \
libmodbus-devel \
# libmodbus-devel \
libxml2-devel \
openssl-devel \
openldap-devel \
make \
mysql-devel \
mysql8.4-devel \
net-snmp-devel \
OpenIPMI-devel \
openldap-devel \
sqlite-devel \
postgresql-private-devel \
postgresql-server-devel \
java-17-openjdk-devel \
java-21-openjdk-devel \
git \
gettext \
unixODBC-devel \
zlib-devel" && \
microdnf -y module enable \
--disablerepo "*" \
--enablerepo "ol9_appstream" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
postgresql:16 && \
microdnf -y install \
--disablerepo "*" \
--enablerepo "ol9_baseos_latest" \
--enablerepo "ol9_appstream" \
--enablerepo "ol9_codeready_builder" \
--enablerepo="ol9_developer_EPEL" \
--enablerepo "ol10_baseos_latest" \
--enablerepo "ol10_appstream" \
--enablerepo "ol10_codeready_builder" \
--enablerepo="ol10_u0_developer_EPEL" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
--best \
--nodocs ${INSTALL_PKGS} && \
microdnf -y clean all
--nodocs ${INSTALL_PKGS}

View File

@ -0,0 +1,6 @@
[ol10_u0_developer_EPEL]
name=Oracle Linux $releasever.0 EPEL Packages for Development ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL10/0/developer/EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

View File

@ -1,6 +0,0 @@
[ol9_developer_EPEL]
name=Oracle Linux $releasever EPEL Packages for Development ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL9/developer/EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0

View File

@ -1,9 +1,10 @@
# syntax=docker/dockerfile:1
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4
ARG OS_BASE_IMAGE=registry.access.redhat.com/ubi10/ubi-minimal:10.1
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION=7.0
ARG RELEASE=0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG RELEASE=6
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
@ -31,7 +32,8 @@ LABEL description="Prepared environment to build Zabbix components" \
COPY ["licenses", "/licenses"]
RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
--mount=type=bind,target=/run/secrets/,src=secrets/ \
--mount=type=tmpfs,target=/var/cache/yum/ \
# --mount=type=bind,target=/run/secrets/,src=secrets/ \
set -eux && \
INSTALL_PKGS="autoconf \
automake \
@ -39,48 +41,42 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
gcc \
go-toolset \
patch \
c-ares-devel \
pcre2-devel \
libcurl-devel \
libevent-devel \
libssh-devel \
libmodbus-devel \
# libmodbus-devel \
libxml2-devel \
openssl-devel \
openldap-devel \
make \
mysql-devel \
mysql8.4-devel \
net-snmp-devel \
OpenIPMI-devel \
openldap-devel \
sqlite-devel \
postgresql-private-devel \
postgresql-server-devel \
java-17-openjdk-devel \
java-21-openjdk-devel \
git \
gettext \
unixODBC-devel \
zlib-devel" && \
curl --tlsv1.2 -sSf -L https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -o /tmp/epel-release-latest-9.noarch.rpm && \
rpm -ivh /tmp/epel-release-latest-9.noarch.rpm && \
rm -rf /tmp/epel-release-latest-9.noarch.rpm && \
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 module enable \
--disablerepo "*" \
--enablerepo "rhel-9-for-$ARCH_SUFFIX-appstream-rpms" \
--setopt=install_weak_deps=0 \
--setopt=keepcache=0 \
postgresql:16 && \
microdnf -y install \
--disablerepo "*" \
--enablerepo "ubi-9-baseos-rpms" \
--enablerepo "ubi-9-appstream-rpms" \
--enablerepo "rhel-9-for-$ARCH_SUFFIX-baseos-rpms" \
--enablerepo "rhel-9-for-$ARCH_SUFFIX-appstream-rpms" \
--enablerepo "codeready-builder-for-rhel-9-$ARCH_SUFFIX-rpms" \
--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} && \
microdnf -y clean all
${INSTALL_PKGS}

View File

@ -1,12 +1,13 @@
# syntax=docker/dockerfile:1
FROM ubuntu:noble
ARG OS_BASE_IMAGE=ubuntu:noble
FROM ${OS_BASE_IMAGE}
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ENV TERM=xterm \
ZBX_VERSION=${ZBX_VERSION} \
PATH=/usr/lib/go-1.22/bin:$PATH
PATH=/usr/lib/go-1.23/bin:$PATH
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" \
@ -17,7 +18,8 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
org.opencontainers.image.vendor="Zabbix SIA" \
org.opencontainers.image.version="${ZBX_VERSION}"
RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
RUN --mount=type=cache,target=/var/cache/apt/,sharing=locked \
--mount=type=cache,target=/var/lib/apt/,sharing=locked \
set -eux && \
INSTALL_PKGS="bash \
autoconf \
@ -26,6 +28,7 @@ RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
curl \
gcc \
libc6-dev \
libc-ares-dev \
libcurl4-openssl-dev \
libevent-dev \
libmodbus-dev \
@ -44,13 +47,30 @@ RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
pkg-config \
gettext \
git \
golang-1.22 \
golang-1.23 \
unzip \
unixodbc-dev \
zlib1g-dev" && \
apt-get -y update && \
DEBIAN_FRONTEND=noninteractive apt-get -y \
--no-install-recommends install \
gpg \
dirmngr \
gpg-agent && \
DISTRIB_CODENAME=$(/bin/bash -c 'source /etc/lsb-release && echo $DISTRIB_CODENAME') && \
echo "deb http://apt.postgresql.org/pub/repos/apt $DISTRIB_CODENAME-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
key='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' && \
export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && \
gpg --batch --export "$key" > /etc/apt/trusted.gpg.d/postgresql.gpg && \
gpgconf --kill all && \
rm -rf "$GNUPGHOME" && \
apt-get -y update && \
DEBIAN_FRONTEND=noninteractive apt-get -y \
--no-install-recommends install \
${INSTALL_PKGS} && \
apt-get -y autoremove && \
apt-get -y clean
DEBIAN_FRONTEND=noninteractive apt-get -y \
purge \
gpg \
dirmngr \
gpg-agent

View File

@ -0,0 +1,148 @@
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,39 +1,146 @@
# syntax=docker/dockerfile:1
# escape=`
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM $BUILD_BASE_IMAGE as builder_base
ARG OS_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
ARG PCRE2_VERSION=10.43
ARG OPENSSL_VERSION=3.3.0
ARG LIBMODBUS_VERSION=3.1.10
ARG GIT_VERSION=2.52.0
ARG NASM_VERSION=3.01
ARG VS_BUILDTOOLS_VERSION=17
ARG PWSH_VERSION=7.5.4
ARG PCRE2_VERSION=10.47
ARG OPENSSL_VERSION=3.5.4
ARG LIBMODBUS_VERSION=3.1.11
ARG ZLIB_VERSION=1.3.1
ARG CURL_VERSION=8.7.1
ARG CURL_VERSION=8.17.0
ARG BUILD_ARCH=x64
ARG CPU_MODEL=AMD64
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
FROM ${OS_BASE_IMAGE} AS src
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-busybox-64-bit.zip
ARG PERL_URL=https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_53822_64bit/strawberry-perl-5.38.2.2-64bit-portable.zip
ARG GIT_VERSION
ARG NASM_VERSION
ARG VS_BUILDTOOLS_VERSION
ARG PWSH_VERSION
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
ARG NASM_URL=https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/win64/nasm-2.16.03-installer-x64.exe
ARG PCRE2_VERSION
ARG OPENSSL_VERSION
ARG LIBMODBUS_VERSION
ARG ZLIB_VERSION
ARG CURL_VERSION
ARG PCRE2_URL=https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.zip
ARG OPENSSL_URL=https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v$GIT_VERSION.windows.1/MinGit-$GIT_VERSION-64-bit.zip
ARG PERL_URL=https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54201_64bit/strawberry-perl-5.42.0.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:967311f84955316969bdb1d8d4b983718ef42338639c621ec4c34fddef355e99 $OPENSSL_URL build_src\openssl.tar.gz
ADD --checksum=sha256:15b4b2e0f68122c2da9b195de5c330489a9c97d40b4a95d2822378dc14d780e7 $LIBMODBUS_URL build_src\libmodbus.tar.gz
ADD --checksum=sha256:9A93B2B7DFDAC77CEBA5A558A580E74667DD6FEDE4585B91EEFB60F03B72DF23 $ZLIB_URL build_src\zlib.tar.gz
ADD --checksum=sha256:e8e74cdeefe5fb78b3ae6e90cd542babf788fa9480029cfcee6fd9ced42b7910 $CURL_URL build_src\curl.tar.gz
ADD --checksum=sha256:b40d192ae95ba6ccc4cc362ff4e1b18ca6fb5055bebbcd3920684e12701fa8f6 $PWSH_URL build_deps\pwsh.zip
ADD --checksum=sha256:f42a561840627747ad48e6ece05a14093292d31f3393a401a7f7c780ee7695c2 $GIT_URL build_deps\git.zip
ADD --checksum=sha256:a1cde185656cf307b51670eed69f648b9eff15b5c518cb136e027c628e650b71 $PERL_URL build_deps\perl.zip
ADD --checksum=sha256:e0ba5157007abc7b1a65118a96657a961ddf55f7e3f632ee035366dfce039ca4 $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; `
`
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; `
Remove-Item -Force -Recurse $env:BUILD_SRC\*.zip; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.tar.gz; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.zip;
FROM ${OS_BASE_IMAGE}
ARG GIT_VERSION
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 `
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
GIT_URL=$GIT_URL PERL_URL=$PERL_URL NASM_URL=$NASM_URL `
VS_BUILDTOOLS_URL=$VS_BUILDTOOLS_URL `
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION LIBMODBUS_VERSION=$LIBMODBUS_VERSION `
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL LIBMODBUS_URL=$LIBMODBUS_URL `
ZLIB_URL=$ZLIB_URL CURL_URL=$CURL_URL
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>" `
@ -44,89 +151,44 @@ LABEL org.opencontainers.image.title="Zabbix agent build base for Windows" `
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';"]
COPY modbus.vs16.* C:\build_src\libmodbus_project\
RUN Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
$env:PATH = [string]::Format('{0}\perl\perl\bin;{1}\NASM;{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); `
$env:BUILD_DEPS = [string]::Format('{0}\build_deps', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_DEPS', $env:BUILD_DEPS, [EnvironmentVariableTarget]::Machine); `
`
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
`
$sha256 = '273f55e881094d00877d64f56570b0c997c4da5dedcb26738d56481033c1eba1'; `
$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:NASM_URL); `
Invoke-WebRequest -OutFile $env:TEMP\nasm_installer.exe -Uri $env:NASM_URL; `
`
$sha256 = '657E1252676CFB26A008835C20A760F731C8E0414469A4ED0F83F0FB059CDD35'; `
$d_sha256 = (Get-FileHash $env:TEMP\nasm_installer.exe -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ((Get-FileHash $env:TEMP\nasm_installer.exe -Algorithm sha256).Hash -ne $sha256) { `
Write-Host ('Checksum NASM ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:PERL_URL); `
Invoke-WebRequest -OutFile $env:TEMP\perl.zip -Uri $env:PERL_URL; `
`
$sha256 = 'EA451686065D6338D7E4D4A04C9AF49F17951D15AA4C2E19AB8CB56FA2373440'; `
$d_sha256 = (Get-FileHash $env:TEMP\perl.zip -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum Strawberry Perl ({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\.; `
$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") ...'; `
Write-Host $env:VS_BUILDTOOLS_VERSION; `
git version; `
Write-Host 'Installing NASM...'; `
Start-Process `
-FilePath $env:TEMP\nasm_installer.exe `
-ArgumentList '/S' -Wait; `
`
Write-Host 'Verifying install ("nasm -v") ...'; `
nasm -v; `
`
Write-Host 'Installing Perl...'; `
Expand-Archive -Path $env:TEMP\perl.zip -DestinationPath $env:SystemDrive\perl\; `
Remove-Item -Force -Recurse $env:SystemDrive\perl\c\; `
`
Write-Host 'Verifying install ("perl -V") ...'; `
perl -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:TEMP\vs_buildtools.exe `
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/17/release/channel `
--installChannelUri https://aka.ms/vs/17/release/channel `
--channelId VisualStudio.17.Release `
--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; `
@ -142,196 +204,124 @@ RUN Set-Location -Path $env:SystemDrive\.; `
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...'; `
`
Set-Location -Path $env:SystemDrive\.; `
[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 ('Downloading {0} ...' -f $env:PCRE2_URL); `
Invoke-WebRequest -OutFile $env:TEMP\pcre2.zip -Uri $env:PCRE2_URL; `
`
$sha256 = 'F2816E84DD7A402068797501BF69E24ECA18D882ADB2143DE9F831F39B850257'; `
$d_sha256 = (Get-FileHash $env:TEMP\pcre2.zip -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum PCRE2 library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:OPENSSL_URL); `
Invoke-WebRequest -OutFile $env:TEMP\openssl.tar.gz -Uri $env:OPENSSL_URL; `
`
$sha256 = '53E66B043322A606ABF0087E7699A0E033A37FA13FEB9742DF35C3A33B18FB02'; `
$d_sha256 = (Get-FileHash $env:TEMP\openssl.tar.gz -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum OpenSSL library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:LIBMODBUS_URL); `
Invoke-WebRequest -OutFile $env:TEMP\libmodbus.tar.gz -Uri $env:LIBMODBUS_URL; `
`
$sha256 = 'E93503749CD89FDA4C8CF1EE6371A3A9CC1F0A921C165AFBBC4FD96D4813FA1A'; `
$d_sha256 = (Get-FileHash $env:TEMP\libmodbus.tar.gz -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum Libmodbus library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:ZLIB_URL); `
Invoke-WebRequest -OutFile $env:TEMP\zlib.tar.gz -Uri $env:ZLIB_URL; `
`
$sha256 = '9A93B2B7DFDAC77CEBA5A558A580E74667DD6FEDE4585B91EEFB60F03B72DF23'; `
$d_sha256 = (Get-FileHash $env:TEMP\zlib.tar.gz -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum Zlib library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:CURL_URL); `
Invoke-WebRequest -OutFile $env:TEMP\curl.tar.gz -Uri $env:CURL_URL; `
`
$sha256 = 'F91249C87F68EA00CF27C44FDFA5A78423E41E71B7D408E5901A9896D905C495'; `
$d_sha256 = (Get-FileHash $env:TEMP\curl.tar.gz -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum Curl library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host 'Extracting PCRE2 archive ...'; `
Expand-Archive -Path $env:TEMP\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:TEMP\openssl.tar.gz; `
Rename-Item -Path $env:BUILD_SRC\openssl-$env:OPENSSL_VERSION -NewName $env:BUILD_SRC\openssl; `
`
Write-Host 'Extracting Libmodbus archive ...'; `
tar -zxf $env:TEMP\libmodbus.tar.gz; `
Move-Item -Path $env:BUILD_SRC\libmodbus-$env:LIBMODBUS_VERSION\ -Destination $env:BUILD_SRC\libmodbus; `
Move-Item -Path $env:BUILD_SRC\libmodbus_project\* -Destination $env:BUILD_SRC\libmodbus\src\win32; `
`
Write-Host 'Extracting Zlib archive ...'; `
tar -zxf $env:TEMP\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:TEMP\curl.tar.gz; `
Move-Item -Path $env:BUILD_SRC\curl-$env:CURL_VERSION\ -Destination $env:BUILD_SRC\curl; `
`
Set-Location -Path $env:SystemDrive\.; `
`
Import-Module (Get-ChildItem $env:VS_PATH -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName; `
Write-Host 'Build environment is ready...';
RUN Import-Module (Get-ChildItem $env:VS_PATH -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=$env:BUILD_ARCH"""; `
`
Write-Host 'Building Zlib library...'; `
Set-Location -Path $env:BUILD_SRC\zlib; `
(Get-Content .\win32\Makefile.msc).replace('-MD', '-MT') | Set-Content .\win32\Makefile.msc; `
set CL=/MP; `
nmake /S -f .\win32\Makefile.msc; `
New-Item -ItemType directory -Path $env:BUILD_OUTPUT\zlib | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_OUTPUT\zlib\include | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_OUTPUT\zlib\lib | Out-Null; `
Copy-Item $env:BUILD_SRC\zlib\*.h -Destination $env:BUILD_OUTPUT\zlib\include; `
Copy-Item $env:BUILD_SRC\zlib\zlib.lib -Destination $env:BUILD_OUTPUT\zlib\lib; `
Copy-Item $env:BUILD_SRC\zlib\zlib.pdb -Destination $env:BUILD_OUTPUT\zlib\lib; `
nmake /S -f .\win32\Makefile.msc clean | Out-Null; `
Write-Host 'Zlib is ready...'; `
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 `
-DBUILD_SHARED_LIBS=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 (Get-ChildItem $env:VS_PATH -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName; `
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-shared `
no-ui-console `
no-tests `
no-unit-test `
no-capieng `
no-docs `
no-dgram `
no-dtls1-method `
no-dtls1_2-method `
no-gost `
no-shared `
no-srp `
no-tests `
no-ui-console `
no-winstore `
--api=1.1.0 `
--prefix=$env:BUILD_OUTPUT\openssl `
--openssldir=$env:BUILD_OUTPUT\openssl_ssl; `
set CL=/MP; `
nmake /S build_sw; `
nmake /S install_dev; `
nmake /S build_libs; `
nmake /S INSTALLDOCS=0 INSTALLHTML=0 install_dev; `
nmake /S clean | Out-Null; `
Write-Host 'OpenSSL is ready...'; `
Write-Host 'OpenSSL is ready...';
RUN Import-Module (Get-ChildItem $env:VS_PATH -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=x64"""; `
`
Write-Host 'Building PCRE2 library ...'; `
Set-Location -Path $env:BUILD_SRC\pcre2\build; `
cmake --log-level=ERROR `
-G 'Visual Studio 17 2022' `
-A $env:BUILD_ARCH `
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 `
-DPCRE2_BUILD_TESTS=OFF `
-DCMAKE_C_FLAGS_RELEASE:string="""/MT""" ..; `
msbuild PCRE2.sln `
-maxcpucount:"""$env:NUMBER_OF_PROCESSORS""" `
/verbosity:quiet `
/property:Configuration=Release `
/property:Platform=$env:BUILD_ARCH `
/target:pcre2-8-static; `
-DPCRE2_BUILD_PCRE2GREP=OFF `
-DPCRE2_SUPPORT_JIT=OFF `
-DCMAKE_MSVC_RUNTIME_LIBRARY="""MultiThreaded$<$<CONFIG:Debug>:Debug>""" `
-DCMAKE_INSTALL_PREFIX="""$env:BUILD_OUTPUT\pcre2"""; `
`
New-Item -ItemType directory -Path $env:BUILD_OUTPUT\pcre2 | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_OUTPUT\pcre2\include | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_OUTPUT\pcre2\lib | Out-Null; `
Copy-Item $env:BUILD_SRC\pcre2\build\*.h -Destination $env:BUILD_OUTPUT\pcre2\include; `
Copy-Item $env:BUILD_SRC\pcre2\build\Release\* -Destination $env:BUILD_OUTPUT\pcre2\lib; `
Remove-Item -Path $env:BUILD_SRC\pcre2\build\* -Force -Recurse; `
Write-Host 'PCRE2 is ready...'; `
cmake --build $env:BUILD_SRC\pcre2\build --config Release --parallel; `
cmake --install $env:BUILD_SRC\pcre2\build --config Release; `
`
Write-Host 'Building Libmodbus library...'; `
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 (Get-ChildItem $env:VS_PATH -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName; `
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 .\configure.js; `
msbuild modbus.vs16.sln `
-maxcpucount:"""$env:NUMBER_OF_PROCESSORS""" `
/verbosity:quiet `
/property:Configuration=Release `
/property:Platform=$env:BUILD_ARCH; `
`
New-Item -ItemType directory -Path $env:BUILD_OUTPUT\libmodbus | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_OUTPUT\libmodbus\include | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_OUTPUT\libmodbus\lib | Out-Null; `
Copy-Item $env:BUILD_SRC\libmodbus\src\*.h -Destination $env:BUILD_OUTPUT\libmodbus\include; `
Copy-Item $env:BUILD_SRC\libmodbus\src\win32\$env:BUILD_ARCH\Release\*.lib -Destination $env:BUILD_OUTPUT\libmodbus\lib; `
Copy-Item $env:BUILD_SRC\libmodbus\src\win32\$env:BUILD_ARCH\Release\*.pdb -Destination $env:BUILD_OUTPUT\libmodbus\lib; `
Remove-Item -Path $env:BUILD_SRC\libmodbus\src\win32\$env:BUILD_ARCH -Force -Recurse; `
Write-Host 'Libmodbus is ready...'; `
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 (Get-ChildItem $env:VS_PATH -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=x64"""; `
Write-Host 'Building Curl library...'; `
Set-Location -Path $env:BUILD_SRC\curl\winbuild; `
(Get-Content MakefileBuild.vc).replace(' wldap32.lib', '') | Set-Content MakefileBuild.vc; `
set CL=/MP; `
nmake /S -f Makefile.vc `
mode=static `
VC=17 `
DEBUG=no `
CC="""cl.exe /DCURL_DISABLE_LDAP /DCURL_DISABLE_LDAPS""" `
MACHINE=$env:BUILD_ARCH `
USE_IPV6=yes `
ENABLE_UNICODE=yes `
USE_IDN=no `
GEN_PDB=no `
WITH_SSL=static `
SSL_PATH=$env:BUILD_OUTPUT\openssl `
WITH_ZLIB=static `
ZLIB_PATH=$env:BUILD_OUTPUT\zlib `
RTLIBCFG=static; `
`
Move-Item -Path $env:BUILD_SRC\curl\builds\libcurl-vc17-$env:BUILD_ARCH-release-static-ssl-static-zlib-static-sspi\ -Destination $env:BUILD_OUTPUT\curl; `
Remove-Item -Path $env:BUILD_SRC\curl\builds\* -Force -Recurse; `
Write-Host 'Curl is ready...'; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Recurse $env:TEMP\*;
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_LIBCURL_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 `
-DUSE_WIN32_IDN=OFF `
-DZLIB_INCLUDE_DIR="""$env:BUILD_OUTPUT\zlib\include""" `
-DZLIB_LIBRARY="""$env:BUILD_OUTPUT\zlib\lib\zlibstatic.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,38 +1,123 @@
# syntax=docker/dockerfile:1
# escape=`
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM $BUILD_BASE_IMAGE as builder_base
ARG OS_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
ARG PCRE2_VERSION=10.43
ARG OPENSSL_VERSION=3.3.0
ARG GOLANG_VERSION=1.22.3
ARG SEVEN_ZIP_VERSION=2405
ARG PCRE2_VERSION=10.47
ARG OPENSSL_VERSION=3.5.4
ARG GOLANG_VERSION=1.25.5
ARG VS_BUILDTOOLS_VERSION=17
ARG PWSH_VERSION=7.5.4
ARG MSYSTEM=UCRT64
ARG BUILD_ARCH=x64
ARG CPU_MODEL=AMD64
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
FROM ${OS_BASE_IMAGE} as src
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-busybox-64-bit.zip
ARG SEVEN_ZIP_URL=https://www.7-zip.org/a/7z$SEVEN_ZIP_VERSION-$BUILD_ARCH.msi
ARG PCRE2_VERSION
ARG OPENSSL_VERSION
ARG GOLANG_VERSION
ARG VS_BUILDTOOLS_VERSION
ARG PWSH_VERSION
ARG MINGW_URL=https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev1.7z
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
ARG MSYSTEM
ARG MINGW_URL=https://github.com/niXman/mingw-builds-binaries/releases/download/15.2.0-rt_v13-rev0/x86_64-15.2.0-release-win32-seh-ucrt-rt_v13-rev0.7z
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/$VS_BUILDTOOLS_VERSION/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 MSYS2_URL=https://github.com/msys2/msys2-installer/releases/download/2025-12-13/msys2-base-x86_64-20251213.sfx.exe
ARG PCRE2_URL=https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.zip
ARG OPENSSL_URL=https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
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:b40d192ae95ba6ccc4cc362ff4e1b18ca6fb5055bebbcd3920684e12701fa8f6 $PWSH_URL build_deps\pwsh.zip
ADD --checksum=sha256:ae756cce1cb80c819b4fe01b0353807178f532211b47f72d7fa77949de054ebb $GOLANG_URL build_deps\go_lang.zip
ADD --checksum=sha256:9e9f0b912a59d2cfb3ce5a01bae4e7a05e4be4f8ff89e36e0f57606ec525525d $MINGW_URL build_deps\mingw.7z
ADD --checksum=sha256:99f2fee9a7b1c344600ac97347e7be23a1f802d8d843b339ec7473a8ed8d49a6 $MSYS2_URL build_deps\msys2.sfx.exe
ADD $VS_BUILDTOOLS_URL build_deps\vs_buildtools.exe
ADD --checksum=sha256:d74c183c86c77248ad50017c7f45bae8f88106a6cca5d87ad09917e1c6fb0784 $PCRE2_URL build_src\pcre2.zip
ADD --checksum=sha256:967311f84955316969bdb1d8d4b983718ef42338639c621ec4c34fddef355e99 $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:PATH = $env:PATH + [string]::Format(';{0}\mingw64\bin;{0}\go\bin;{0}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:BUILD_DEPS, $env:MSYSTEM.ToLower()); `
[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; `
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-make mingw-w64-ucrt-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:BUILD_DEPS\msys64 | Out-Null; `
`
Write-Host 'Installing Mingw-w64...'; `
7z x $env:BUILD_DEPS\mingw.7z; `
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; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Recurse $env:BUILD_SRC\*.tar.gz; `
Remove-Item -Force -Recurse $env:BUILD_SRC\*.zip; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.tar.gz; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.zip; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\msys2.sfx.exe; `
Remove-Item -Force -Recurse $env:BUILD_DEPS\*.7z;
FROM ${OS_BASE_IMAGE}
ARG PCRE2_VERSION
ARG OPENSSL_VERSION
ARG GOLANG_VERSION
ARG VS_BUILDTOOLS_VERSION
ARG MSYSTEM
ARG MAJOR_VERSION
ARG ZBX_VERSION
ENV ZBX_VERSION=$ZBX_VERSION `
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
GIT_URL=$GIT_URL SEVEN_ZIP_VERSION=$SEVEN_ZIP_VERSION `
MINGW_URL=$MINGW_URL VS_BUILDTOOLS_URL=$VS_BUILDTOOLS_URL GOLANG_VERSION=$GOLANG_VERSION MSYS2_URL=$MSYS2_URL `
VS_BUILDTOOLS_VERSION=$VS_BUILDTOOLS_VERSION GOLANG_VERSION=$GOLANG_VERSION `
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" `
@ -44,138 +129,44 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
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\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
$env:PATH = [string]::Format('{0}\mingw64\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;{1}\7-Zip;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
$env:PATH = $env:PATH + [string]::Format(';{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); `
$env:BUILD_DEPS = [string]::Format('{0}\build_deps', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_DEPS', $env:BUILD_DEPS, [EnvironmentVariableTarget]::Machine); `
`
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
$env:PATH = $env:PATH + [string]::Format(';{0}\mingw64\bin;{0}\go\bin;{0}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:BUILD_DEPS, $env:MSYSTEM.ToLower()); `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
$sha256 = '273f55e881094d00877d64f56570b0c997c4da5dedcb26738d56481033c1eba1'; `
$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:SEVEN_ZIP_URL); `
Invoke-WebRequest -OutFile $env:TEMP\7z.msi -Uri $env:SEVEN_ZIP_URL; `
`
$sha256 = '0F6AA6596D418B1694F62C8583DE05D24589B8D7FFACCE5A7DAB52AE71F832B6'; `
$d_sha256 = (Get-FileHash $env:TEMP\7z.msi -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum 7-zip ({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 = 'cab2af6951a6e2115824263f6df13ff069c47270f5788714fa1d776f7f60cb39'; `
$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:MINGW_URL); `
Invoke-WebRequest -OutFile $env:TEMP\mingw.7z -Uri $env:MINGW_URL; `
`
$sha256 = '74ca64c55220edd3196681782fbff653c2b9cb4f427f9e532ab6e9a0823dc997'; `
$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: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: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 7z...'; `
Start-Process `
-FilePath $env:TEMP\7z.msi `
-Wait `
-ArgumentList '/qn /norestart'; `
`
Write-Host 'Verifying install ("7z -h") ...'; `
7z -h | Select -first 2; `
`
Write-Host 'Installing Go Lang...'; `
Expand-Archive -Path $env:TEMP\go_lang.zip -DestinationPath $env:SystemDrive\; `
New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; `
`
Write-Host 'Verifying install ("go version") ...'; `
go 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 ("bash --version") ...'; `
bash --version; `
`
Write-Host 'Verifying install ("gcc -v") ...'; `
gcc -v; `
`
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-ucrt-x86_64-cmake'; `
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 `
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/17/release/channel `
--installChannelUri https://aka.ms/vs/17/release/channel `
--channelId VisualStudio.17.Release `
--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.VC.Tools.x86.x64; `
if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { `
@ -190,89 +181,51 @@ RUN Set-Location -Path $env:SystemDrive\.; `
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 ('Downloading {0} ...' -f $env:PCRE2_URL); `
Invoke-WebRequest -OutFile $env:TEMP\pcre2.zip -Uri $env:PCRE2_URL; `
`
$sha256 = 'F2816E84DD7A402068797501BF69E24ECA18D882ADB2143DE9F831F39B850257'; `
$d_sha256 = (Get-FileHash $env:TEMP\pcre2.zip -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum PCRE2 library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:OPENSSL_URL); `
Invoke-WebRequest -OutFile $env:TEMP\openssl.tar.gz -Uri $env:OPENSSL_URL; `
`
$sha256 = '53E66B043322A606ABF0087E7699A0E033A37FA13FEB9742DF35C3A33B18FB02'; `
$d_sha256 = (Get-FileHash $env:TEMP\openssl.tar.gz -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum OpenSSL library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host 'Extracting PCRE2 archive ...'; `
Expand-Archive -Path $env:TEMP\pcre2.zip -DestinationPath $env:BUILD_SRC; `
`
Write-Host 'Removing downloaded ...'; `
Remove-Item -Force -Path $env:TEMP\pcre2.zip; `
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:TEMP\openssl.tar.gz"; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Path $env:TEMP\openssl.tar.gz; `
Rename-Item -Path $env:BUILD_SRC\openssl-$env:OPENSSL_VERSION -NewName $env:BUILD_SRC\openssl; `
`
Write-Host 'Building PCRE2 library ...'; `
Write-Host 'Build environment is ready...';
RUN Write-Host 'Building PCRE2 library ...'; `
Set-Location -Path $env:BUILD_SRC\pcre2; `
cmake --log-level=ERROR `
cmake -S $env:BUILD_SRC\pcre2 -B $env:BUILD_SRC\pcre2\build `
-G 'MinGW Makefiles' `
-DBUILD_SHARED_LIBS=OFF `
-DBUILD_STATIC_LIBS=ON `
-DPCRE2_DEBUG=OFF `
-DPCRE2_BUILD_TESTS=OFF `
-DPCRE2_BUILD_PCRE2GREP=OFF `
-DPCRE2_SUPPORT_JIT=OFF `
-DINSTALL_MSVC_PDB=OFF `
-DCMAKE_C_COMPILER=gcc `
-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 -Path $env:BUILD_OUTPUT\pcre2\man -Force -Recurse; `
Remove-Item -Path $env:BUILD_OUTPUT\pcre2\share -Force -Recurse; `
Write-Host 'PCRE2 is ready...'; `
`
Write-Host 'Building OpenSSL library...'; `
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; `
perl Configure `
mingw64 `
no-shared `
no-ui-console `
no-tests `
no-unit-test `
no-capieng `
no-docs `
no-dgram `
no-dtls1-method `
no-dtls1_2-method `
no-gost `
no-shared `
no-srp `
no-tests `
no-ui-console `
no-winstore `
thread_scheme=winthreads `
--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""" 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 'Removing downloaded...'; `
Remove-Item -Force -Recurse $env:TEMP\*;
Write-Host 'Build environment is ready';

View File

@ -3,30 +3,26 @@
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM $BUILD_BASE_IMAGE as builder_base
ARG PCRE2_VERSION=10.43
ARG OPENSSL_VERSION=3.3.0
ARG GOLANG_VERSION=1.22.3
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 CPU_MODEL=AMD64
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-busybox-64-bit.zip
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://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
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 CPU_MODEL=$CPU_MODEL `
GIT_URL=$GIT_URL `
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 `
@ -43,11 +39,13 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
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 = [string]::Format('{0}\mingw64\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;{1}\7-Zip;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
$env:PATH = $env:PATH + [string]::Format(';{0}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
$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); `
@ -55,21 +53,10 @@ 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); `
`
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
`
$sha256 = '273f55e881094d00877d64f56570b0c997c4da5dedcb26738d56481033c1eba1'; `
$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 = 'cab2af6951a6e2115824263f6df13ff069c47270f5788714fa1d776f7f60cb39'; `
$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) { `
@ -94,15 +81,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
# exit 1; `
}; `
`
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\; `
`
@ -114,7 +92,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
& $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'; `
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/*'; `
@ -160,41 +138,13 @@ RUN Set-Location -Path $env:SystemDrive\.; `
New-Item -ItemType directory -Path $env:BUILD_SRC -Force | Out-Null; `
Set-Location -Path $env:BUILD_SRC; `
`
Write-Host ('Downloading {0} ...' -f $env:PCRE2_URL); `
Invoke-WebRequest -OutFile $env:TEMP\pcre2.zip -Uri $env:PCRE2_URL; `
`
$sha256 = 'F2816E84DD7A402068797501BF69E24ECA18D882ADB2143DE9F831F39B850257'; `
$d_sha256 = (Get-FileHash $env:TEMP\pcre2.zip -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum PCRE2 library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:OPENSSL_URL); `
Invoke-WebRequest -OutFile $env:TEMP\openssl.tar.gz -Uri $env:OPENSSL_URL; `
`
$sha256 = '53E66B043322A606ABF0087E7699A0E033A37FA13FEB9742DF35C3A33B18FB02'; `
$d_sha256 = (Get-FileHash $env:TEMP\openssl.tar.gz -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum OpenSSL library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host 'Extracting PCRE2 archive ...'; `
Expand-Archive -Path $env:TEMP\pcre2.zip -DestinationPath $env:BUILD_SRC; `
`
Write-Host 'Removing downloaded ...'; `
Remove-Item -Force -Path $env:TEMP\pcre2.zip; `
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:TEMP\openssl.tar.gz"; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Path $env:TEMP\openssl.tar.gz; `
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 ...'; `
@ -212,7 +162,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
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\man -Force -Recurse; `
Remove-Item -Path $env:BUILD_OUTPUT\pcre2\share -Force -Recurse; `
Write-Host 'PCRE2 is ready...'; `
`

View File

@ -3,33 +3,27 @@
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM $BUILD_BASE_IMAGE as builder_base
ARG PCRE2_VERSION=10.43
ARG OPENSSL_VERSION=3.3.0
ARG GOLANG_VERSION=1.22.3
ARG SEVEN_ZIP_VERSION=2405
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 CPU_MODEL=AMD64
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.0
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-busybox-64-bit.zip
ARG SEVEN_ZIP_URL=https://www.7-zip.org/a/7z$SEVEN_ZIP_VERSION-$BUILD_ARCH.msi
ARG MINGW_URL=https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-win32-seh-msvcrt-rt_v11-rev1.7z
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://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
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 CPU_MODEL=$CPU_MODEL `
GIT_URL=$GIT_URL SEVEN_ZIP_VERSION=$SEVEN_ZIP_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 `
@ -46,11 +40,13 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
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 = [string]::Format('{0}\mingw64\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;{1}\7-Zip;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
$env:PATH = $env:PATH + [string]::Format(';{0}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
$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); `
@ -58,32 +54,10 @@ 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); `
`
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
`
$sha256 = '273f55e881094d00877d64f56570b0c997c4da5dedcb26738d56481033c1eba1'; `
$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:SEVEN_ZIP_URL); `
Invoke-WebRequest -OutFile $env:TEMP\7z.msi -Uri $env:SEVEN_ZIP_URL; `
`
$sha256 = '0F6AA6596D418B1694F62C8583DE05D24589B8D7FFACCE5A7DAB52AE71F832B6'; `
$d_sha256 = (Get-FileHash $env:TEMP\7z.msi -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum 7-zip ({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 = 'cab2af6951a6e2115824263f6df13ff069c47270f5788714fa1d776f7f60cb39'; `
$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) { `
@ -91,17 +65,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:MINGW_URL); `
Invoke-WebRequest -OutFile $env:TEMP\mingw.7z -Uri $env:MINGW_URL; `
`
$sha256 = '15B914F38F2F2E2D6F7B9B8425FF22B7E406878B01920190B09CE0DD8259C6AA'; `
$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:MSYS2_URL); `
Invoke-WebRequest -OutFile $env:TEMP\msys2.sfx.exe -Uri $(Invoke-RestMethod -UseBasicParsing $env:MSYS2_URL | `
Select -ExpandProperty "assets" | `
@ -116,45 +79,31 @@ RUN Set-Location -Path $env:SystemDrive\.; `
# 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 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 7z...'; `
Start-Process `
-FilePath $env:TEMP\7z.msi `
-Wait `
-ArgumentList '/qn /norestart'; `
`
Write-Host 'Verifying install ("7z -h") ...'; `
7z -h | Select -first 2; `
`
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 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 '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'; `
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/*'; `
@ -166,6 +115,13 @@ RUN Set-Location -Path $env:SystemDrive\.; `
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 `
@ -200,41 +156,13 @@ RUN Set-Location -Path $env:SystemDrive\.; `
New-Item -ItemType directory -Path $env:BUILD_SRC -Force | Out-Null; `
Set-Location -Path $env:BUILD_SRC; `
`
Write-Host ('Downloading {0} ...' -f $env:PCRE2_URL); `
Invoke-WebRequest -OutFile $env:TEMP\pcre2.zip -Uri $env:PCRE2_URL; `
`
$sha256 = 'F2816E84DD7A402068797501BF69E24ECA18D882ADB2143DE9F831F39B850257'; `
$d_sha256 = (Get-FileHash $env:TEMP\pcre2.zip -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum PCRE2 library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host ('Downloading {0} ...' -f $env:OPENSSL_URL); `
Invoke-WebRequest -OutFile $env:TEMP\openssl.tar.gz -Uri $env:OPENSSL_URL; `
`
$sha256 = '53E66B043322A606ABF0087E7699A0E033A37FA13FEB9742DF35C3A33B18FB02'; `
$d_sha256 = (Get-FileHash $env:TEMP\openssl.tar.gz -Algorithm sha256).Hash; `
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
if ($d_sha256 -ne $sha256) { `
Write-Host ('Checksum OpenSSL library ({0}) failed!' -f $d_sha256); `
exit 1; `
}; `
`
Write-Host 'Extracting PCRE2 archive ...'; `
Expand-Archive -Path $env:TEMP\pcre2.zip -DestinationPath $env:BUILD_SRC; `
`
Write-Host 'Removing downloaded ...'; `
Remove-Item -Force -Path $env:TEMP\pcre2.zip; `
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:TEMP\openssl.tar.gz"; `
`
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Path $env:TEMP\openssl.tar.gz; `
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 ...'; `
@ -252,7 +180,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
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\man -Force -Recurse; `
Remove-Item -Path $env:BUILD_OUTPUT\pcre2\share -Force -Recurse; `
Write-Host 'PCRE2 is ready...'; `
`

View File

@ -3,23 +3,22 @@
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM $BUILD_BASE_IMAGE as builder_base
ARG GOLANG_VERSION=1.22.3
ARG GOLANG_VERSION=1.23.2
ARG BUILD_ARCH=x64
ARG CPU_MODEL=AMD64
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.0
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-busybox-64-bit.zip
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/20240502/llvm-mingw-20240502-ucrt-x86_64.zip
ARG VCPKG_GIT=https://github.com/microsoft/vcpkg
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 CPU_MODEL=$CPU_MODEL `
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
@ -49,7 +48,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
`
$sha256 = '273f55e881094d00877d64f56570b0c997c4da5dedcb26738d56481033c1eba1'; `
$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) { `
@ -60,7 +59,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Write-Host ('Downloading {0} ...' -f $env:GOLANG_URL); `
Invoke-WebRequest -OutFile $env:TEMP\go_lang.zip -Uri $env:GOLANG_URL; `
`
$sha256 = 'cab2af6951a6e2115824263f6df13ff069c47270f5788714fa1d776f7f60cb39'; `
$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) { `
@ -71,7 +70,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Write-Host ('Downloading {0} ...' -f $env:LLVM_MINGW); `
Invoke-WebRequest -OutFile $env:TEMP\llvm_mingw.zip -Uri $env:LLVM_MINGW; `
`
$sha256 = '2487683A7341FFA4D0C1D107268D22DC722A43EA2E7C7F46DA0648E34F4F4C8B'; `
$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) { `
@ -98,9 +97,9 @@ RUN Set-Location -Path $env:SystemDrive\.; `
`
Write-Host 'Installing LLVM MinGW ...'; `
Expand-Archive -Path $env:TEMP\llvm_mingw.zip -DestinationPath $env:SystemDrive\; `
Move-Item -Path $env:SystemDrive\llvm-mingw-20240502-ucrt-x86_64\ -Destination $env:SystemDrive\llvm_mingw; `
Move-Item -Path $env:SystemDrive\llvm-mingw-20241030-ucrt-x86_64\ -Destination $env:SystemDrive\llvm_mingw; `
`
Write-Host 'Verifying install ("git version") ...'; `
Write-Host 'Verifying install ("gcc -v") ...'; `
gcc -v; `
`
Write-Host ('{0} - Visual Studio components installing...' -f $(Get-Date -format 'u')); `

View File

@ -1,31 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modbus", "modbus.vs16.vcxproj", "{498E0845-C7F4-438B-8EDE-EF7FC9A74430}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Debug|x64.ActiveCfg = Debug|x64
{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Debug|x64.Build.0 = Debug|x64
{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Debug|x86.ActiveCfg = Debug|Win32
{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Debug|x86.Build.0 = Debug|Win32
{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Release|x64.ActiveCfg = Release|x64
{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Release|x64.Build.0 = Release|x64
{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Release|x86.ActiveCfg = Release|Win32
{498E0845-C7F4-438B-8EDE-EF7FC9A74430}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6CF51673-664F-4C9F-B3FE-991FF423F3B6}
EndGlobalSection
EndGlobal

View File

@ -1,265 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>modbus</ProjectName>
<ProjectGuid>{498E0845-C7F4-438B-8EDE-EF7FC9A74430}</ProjectGuid>
<RootNamespace>modbus</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>16.0.29511.113</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<EnableManagedIncrementalBuild>False</EnableManagedIncrementalBuild>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>true</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<EnableManagedIncrementalBuild>False</EnableManagedIncrementalBuild>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>true</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Command />
</PreBuildEvent>
<CustomBuildStep>
<Message />
<Command />
</CustomBuildStep>
<ClCompile>
<Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>.;..</AdditionalIncludeDirectories>
<PreprocessorDefinitions>W32DEBUG;HAVE_CONFIG_H;DLLBUILD;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NONSTDC_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<ExceptionHandling />
<BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<FloatingPointModel>Fast</FloatingPointModel>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_MSC_VER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ResourceOutputFileName>$(SolutionDir)/modbus.res</ResourceOutputFileName>
</ResourceCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<Version>
</Version>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress />
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command />
</PreBuildEvent>
<CustomBuildStep>
<Message />
<Command />
</CustomBuildStep>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>.;..</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_CONFIG_H;DLLBUILD;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NONSTDC_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling />
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>false</FunctionLevelLinking>
<FloatingPointModel>Fast</FloatingPointModel>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<StackReserveSize>1048576</StackReserveSize>
<StackCommitSize>524288</StackCommitSize>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LinkTimeCodeGeneration />
<EntryPointSymbol />
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PreBuildEvent>
<Command />
</PreBuildEvent>
<CustomBuildStep>
<Message />
<Command />
</CustomBuildStep>
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>.;..</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<DisableSpecificWarnings>4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PreprocessorDefinitions>W32DEBUG;_WINDLL;HAVE_CONFIG_H;DLLBUILD;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NONSTDC_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<StackReserveSize>1048576</StackReserveSize>
<StackCommitSize>524288</StackCommitSize>
<TargetMachine>MachineX64</TargetMachine>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEvent>
<Command />
</PreBuildEvent>
<CustomBuildStep>
<Message />
<Command />
</CustomBuildStep>
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>.;..</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<DisableSpecificWarnings>4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<PreprocessorDefinitions>_WINDLL;HAVE_CONFIG_H;DLLBUILD;_CRT_SECURE_NO_DEPRECATE=1;_CRT_NONSTDC_NO_DEPRECATE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<StackReserveSize>1048576</StackReserveSize>
<StackCommitSize>524288</StackCommitSize>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<LinkTimeCodeGeneration />
<TargetMachine>MachineX64</TargetMachine>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\modbus-data.c" />
<ClCompile Include="..\modbus-rtu.c" />
<ClCompile Include="..\modbus-tcp.c" />
<ClCompile Include="..\modbus.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\modbus-private.h" />
<ClInclude Include="..\modbus-rtu-private.h" />
<ClInclude Include="..\modbus-rtu.h" />
<ClInclude Include="..\modbus-tcp-private.h" />
<ClInclude Include="..\modbus-tcp.h" />
<ClInclude Include="..\modbus.h" />
<ClInclude Include="config.h" />
<ClInclude Include="modbus-version.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="modbus.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\modbus-data.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\modbus-rtu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\modbus-tcp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\modbus.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\modbus-private.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\modbus-rtu-private.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\modbus-rtu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\modbus-tcp-private.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\modbus-tcp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="modbus-version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\modbus.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="modbus.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -14,15 +14,17 @@ Zabbix build base (MySQL) image is used for building Zabbix components. It conta
# Zabbix build base (MySQL) images
These are the only official Zabbix build base (MySQL) Docker images. They are based on Alpine Linux v3.20, Ubuntu 24.04 (noble), CentOS Stream 9 and Oracle Linux 9 images. The available versions of the image are:
These are the only official Zabbix build base (MySQL) Docker images. They are based on Alpine Linux v3.23, Ubuntu 24.04 (noble), CentOS Stream 10 and Oracle Linux 10 images. The available versions of the image are:
Zabbix build base 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, ol-5.0-latest)
Zabbix build base 5.0.* (tags: alpine-5.0.*, ubuntu-5.0.*, ol-5.0.*)
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 6.4 (tags: alpine-6.4-latest, ubuntu-6.4-latest, ol-6.4-latest, alpine-latest, ubuntu-latest, ol-latest, latest)
Zabbix build base 6.4.* (tags: alpine-6.4.*, ubuntu-6.4.*, ol-6.4.*)
Zabbix build base 7.0 (tags: alpine-trunk, ubuntu-trunk, ol-trunk)
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.
@ -30,7 +32,7 @@ Images are updated when new releases are published. The image with ``latest`` ta
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/trunk/Dockerfiles/build-base) image with prepared build environment as base image and build / compile Zabbix components only.
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
@ -64,7 +66,7 @@ Please see [the Docker installation documentation](https://docs.docker.com/insta
## Documentation
Documentation for this image is stored in the [`build-base/` directory](https://github.com/zabbix/zabbix-docker/tree/trunk/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/master/README.md) before attempting a pull request.
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/master/README.md) before attempting a pull request.
## Issues

View File

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-base:alpine-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
@ -8,7 +8,10 @@ FROM ${BUILD_BASE_IMAGE} AS builder
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH=master
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
@ -22,14 +25,18 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
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=type=cache,target=/root/.cache/go-build/ \
--mount=type=cache,target=/root/go/ \
--mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
--mount=from=sources,target=/tmp/src \
--mount=type=bind,source=patches/,target=/tmp/patches \
--mount=from=config_templates,target=/tmp/conf \
set -eux && \
cd /tmp/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
@ -49,27 +56,35 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \
if [ -f "/tmp/src/bootstrap.sh" ]; then \
cp -R /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} && \
patch -p1 < /tmp/chromedp_no_sandbox.patch && \
for patch_filename in /tmp/patches/*.patch; do \
if [ -f "$patch_filename" ]; then \
patch -p1 < "$patch_filename"; \
fi \
done && \
zabbix_revision=`git rev-parse --short HEAD` && \
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 && \
./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-ipv6 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
--with-ares \
--with-ldap \
--with-libcurl \
--with-libmodbus \
@ -81,7 +96,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-openssl \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
@ -93,7 +107,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
gzip -c database/${DB_TYPE}/create.sql > ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz && \
rm -rf database/${DB_TYPE}/create.sql && \
mkdir /tmp/fonts/ && \
curl --tlsv1.2 -sSf -L "https://noto-website.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
curl --tlsv1.2 -sSf -L "https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
unzip /tmp/fonts/NotoSansCJKjp-hinted.zip -d /tmp/fonts/ && \
cp /tmp/fonts/NotoSansCJKjp-Regular.otf ${ZBX_SOURCES_DIR}/ui/assets/fonts/NotoSansCJKjp-Regular.ttf && \
cp /tmp/fonts/LICENSE_OFL.txt ${ZBX_SOURCES_DIR}/ui/assets/fonts/ && \
@ -109,19 +123,24 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
strip ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender && \
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf_template && \
cp -R ${ZBX_SOURCES_DIR}/conf/zabbix_agentd/ ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp /tmp/conf/agent/* ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf_template && \
cp /tmp/conf/agent2/* ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.d/ ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_server/zabbix_server ${ZBX_OUTPUT_DIR}/server/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf_template && \
cp /tmp/conf/server/* ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf_template && \
cp /tmp/conf/proxy/* ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/bin/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/lib/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service ${ZBX_OUTPUT_DIR}/web_service/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf_template && \
cp /tmp/conf/web_service/* ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get ${ZBX_OUTPUT_DIR}/general/bin/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender ${ZBX_OUTPUT_DIR}/general/bin/ && \
make -s distclean && \
@ -154,4 +173,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
make && \
strip /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
cd /tmp/ && \
git -c advice.detachedHead=false clone ${NVIDIA_GPU_PLUGIN_SOURCES} --branch ${NVIDIA_GPU_PLUGIN_VERSION} --depth 1 --single-branch /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
cd /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
make && \
strip /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/nvidia.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/

View File

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-base:centos-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
@ -8,7 +8,10 @@ FROM ${BUILD_BASE_IMAGE} AS builder
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH=master
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
@ -22,14 +25,18 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
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=type=cache,target=/root/.cache/go-build/ \
--mount=type=cache,target=/root/go/ \
--mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
--mount=from=sources,target=/tmp/src \
--mount=type=bind,source=patches/,target=/tmp/patches \
--mount=from=config_templates,target=/tmp/conf \
set -eux && \
cd /tmp/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
@ -49,16 +56,22 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \
if [ -f "/tmp/src/bootstrap.sh" ]; then \
cp -R /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} && \
patch -p1 < /tmp/chromedp_no_sandbox.patch && \
for patch_filename in /tmp/patches/*.patch; do \
if [ -f "$patch_filename" ]; then \
patch -p1 < "$patch_filename"; \
fi \
done && \
zabbix_revision=`git rev-parse --short HEAD` && \
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 && \
./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
@ -67,12 +80,14 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
--with-ares \
--with-ldap \
--with-libcurl \
--with-libmodbus \
# --with-libmodbus \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
@ -81,7 +96,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-openssl \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
@ -93,7 +107,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
gzip -c database/${DB_TYPE}/create.sql > ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz && \
rm -rf database/${DB_TYPE}/create.sql && \
mkdir /tmp/fonts/ && \
curl --tlsv1.2 -sSf -L "https://noto-website.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
curl --tlsv1.2 -sSf -L "https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
unzip /tmp/fonts/NotoSansCJKjp-hinted.zip -d /tmp/fonts/ && \
cp /tmp/fonts/NotoSansCJKjp-Regular.otf ${ZBX_SOURCES_DIR}/ui/assets/fonts/NotoSansCJKjp-Regular.ttf && \
cp /tmp/fonts/LICENSE_OFL.txt ${ZBX_SOURCES_DIR}/ui/assets/fonts/ && \
@ -109,19 +123,24 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
strip ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender && \
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf_template && \
cp -R ${ZBX_SOURCES_DIR}/conf/zabbix_agentd/ ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp /tmp/conf/agent/* ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf_template && \
cp /tmp/conf/agent2/* ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.d/ ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_server/zabbix_server ${ZBX_OUTPUT_DIR}/server/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf_template && \
cp /tmp/conf/server/* ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf_template && \
cp /tmp/conf/proxy/* ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/bin/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/lib/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service ${ZBX_OUTPUT_DIR}/web_service/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf_template && \
cp /tmp/conf/web_service/* ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get ${ZBX_OUTPUT_DIR}/general/bin/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender ${ZBX_OUTPUT_DIR}/general/bin/ && \
make -s distclean && \
@ -154,4 +173,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
make && \
strip /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
cd /tmp/ && \
git -c advice.detachedHead=false clone ${NVIDIA_GPU_PLUGIN_SOURCES} --branch ${NVIDIA_GPU_PLUGIN_VERSION} --depth 1 --single-branch /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
cd /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
make && \
strip /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/nvidia.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/

View File

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-base:ol-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
@ -8,7 +8,10 @@ FROM ${BUILD_BASE_IMAGE} AS builder
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH=master
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
@ -22,14 +25,18 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
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=type=cache,target=/root/.cache/go-build/ \
--mount=type=cache,target=/root/go/ \
--mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
--mount=from=sources,target=/tmp/src \
--mount=type=bind,source=patches/,target=/tmp/patches \
--mount=from=config_templates,target=/tmp/conf \
set -eux && \
cd /tmp/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
@ -49,16 +56,22 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \
if [ -f "/tmp/src/bootstrap.sh" ]; then \
cp -R /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} && \
patch -p1 < /tmp/chromedp_no_sandbox.patch && \
for patch_filename in /tmp/patches/*.patch; do \
if [ -f "$patch_filename" ]; then \
patch -p1 < "$patch_filename"; \
fi \
done && \
zabbix_revision=`git rev-parse --short HEAD` && \
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 && \
./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
@ -71,9 +84,10 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--enable-proxy \
--enable-server \
--enable-webservice \
--with-ares \
--with-ldap \
--with-libcurl \
--with-libmodbus \
# --with-libmodbus \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
@ -93,7 +107,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
gzip -c database/${DB_TYPE}/create.sql > ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz && \
rm -rf database/${DB_TYPE}/create.sql && \
mkdir /tmp/fonts/ && \
curl --tlsv1.2 -sSf -L "https://noto-website.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
curl --tlsv1.2 -sSf -L "https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
unzip /tmp/fonts/NotoSansCJKjp-hinted.zip -d /tmp/fonts/ && \
cp /tmp/fonts/NotoSansCJKjp-Regular.otf ${ZBX_SOURCES_DIR}/ui/assets/fonts/NotoSansCJKjp-Regular.ttf && \
cp /tmp/fonts/LICENSE_OFL.txt ${ZBX_SOURCES_DIR}/ui/assets/fonts/ && \
@ -109,19 +123,24 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
strip ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender && \
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf_template && \
cp -R ${ZBX_SOURCES_DIR}/conf/zabbix_agentd/ ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp /tmp/conf/agent/* ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf_template && \
cp /tmp/conf/agent2/* ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.d/ ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_server/zabbix_server ${ZBX_OUTPUT_DIR}/server/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf_template && \
cp /tmp/conf/server/* ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf_template && \
cp /tmp/conf/proxy/* ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/bin/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/lib/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service ${ZBX_OUTPUT_DIR}/web_service/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf_template && \
cp /tmp/conf/web_service/* ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get ${ZBX_OUTPUT_DIR}/general/bin/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender ${ZBX_OUTPUT_DIR}/general/bin/ && \
make -s distclean && \
@ -154,4 +173,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
make && \
strip /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
cd /tmp/ && \
git -c advice.detachedHead=false clone ${NVIDIA_GPU_PLUGIN_SOURCES} --branch ${NVIDIA_GPU_PLUGIN_VERSION} --depth 1 --single-branch /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
cd /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
make && \
strip /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/nvidia.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/

View File

@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG RELEASE=0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG RELEASE=6
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-base:rhel-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
@ -10,11 +10,14 @@ ARG MAJOR_VERSION
ARG RELEASE
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH=master
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS
LABEL description="Zabbix build base for MySQL based images" \
maintainer="alexey.pustovalov@zabbix.com" \
name="zabbix/zabbix-build-mysql-trunk" \
name="zabbix/zabbix-build-mysql-74" \
release="${RELEASE}" \
summary="Zabbix build base (MySQL)" \
url="https://www.zabbix.com/" \
@ -33,14 +36,18 @@ LABEL description="Zabbix build base for MySQL based images" \
ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
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=type=cache,target=/root/.cache/go-build/ \
--mount=type=cache,target=/root/go/ \
--mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
--mount=from=sources,target=/tmp/src,z \
--mount=type=bind,source=patches/,target=/tmp/patches,z \
--mount=from=config_templates,target=/tmp/conf,z \
set -eux && \
cd /tmp/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
@ -60,16 +67,22 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \
if [ -f "/tmp/src/bootstrap.sh" ]; then \
cp -R /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} && \
patch -p1 < /tmp/chromedp_no_sandbox.patch && \
for patch_filename in /tmp/patches/*.patch; do \
if [ -f "$patch_filename" ]; then \
patch -p1 < "$patch_filename"; \
fi \
done && \
zabbix_revision=`git rev-parse --short HEAD` && \
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 && \
./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
@ -78,12 +91,14 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
--with-ares \
--with-ldap \
--with-libcurl \
--with-libmodbus \
# --with-libmodbus \
--with-libpcre2 \
--with-libxml2 \
--with-${DB_TYPE} \
@ -92,7 +107,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-openssl \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
@ -104,7 +118,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
gzip -c database/${DB_TYPE}/create.sql > ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz && \
rm -rf database/${DB_TYPE}/create.sql && \
mkdir /tmp/fonts/ && \
curl --tlsv1.2 -sSf -L "https://noto-website.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
curl --tlsv1.2 -sSf -L "https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
unzip /tmp/fonts/NotoSansCJKjp-hinted.zip -d /tmp/fonts/ && \
cp /tmp/fonts/NotoSansCJKjp-Regular.otf ${ZBX_SOURCES_DIR}/ui/assets/fonts/NotoSansCJKjp-Regular.ttf && \
cp /tmp/fonts/LICENSE_OFL.txt ${ZBX_SOURCES_DIR}/ui/assets/fonts/ && \
@ -120,19 +134,24 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
strip ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender && \
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf_template && \
cp -R ${ZBX_SOURCES_DIR}/conf/zabbix_agentd/ ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp /tmp/conf/agent/* ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf_template && \
cp /tmp/conf/agent2/* ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.d/ ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_server/zabbix_server ${ZBX_OUTPUT_DIR}/server/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf_template && \
cp /tmp/conf/server/* ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf_template && \
cp /tmp/conf/proxy/* ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/bin/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/lib/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service ${ZBX_OUTPUT_DIR}/web_service/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf_template && \
cp /tmp/conf/web_service/* ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get ${ZBX_OUTPUT_DIR}/general/bin/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender ${ZBX_OUTPUT_DIR}/general/bin/ && \
make -s distclean && \
@ -165,4 +184,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
make && \
strip /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
cd /tmp/ && \
git -c advice.detachedHead=false clone ${NVIDIA_GPU_PLUGIN_SOURCES} --branch ${NVIDIA_GPU_PLUGIN_VERSION} --depth 1 --single-branch /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
cd /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
make && \
strip /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/nvidia.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/

View File

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-base:ubuntu-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
@ -8,7 +8,10 @@ FROM ${BUILD_BASE_IMAGE} AS builder
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH=master
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for MySQL based images" \
@ -22,14 +25,18 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=mysql \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
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=type=cache,target=/root/.cache/go-build/ \
--mount=type=cache,target=/root/go/ \
--mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
--mount=from=sources,target=/tmp/src \
--mount=type=bind,source=patches/,target=/tmp/patches \
--mount=from=config_templates,target=/tmp/conf \
set -eux && \
cd /tmp/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
@ -49,16 +56,22 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \
if [ -f "/tmp/src/bootstrap.sh" ]; then \
cp -R /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} && \
patch -p1 < /tmp/chromedp_no_sandbox.patch && \
for patch_filename in /tmp/patches/*.patch; do \
if [ -f "$patch_filename" ]; then \
patch -p1 < "$patch_filename"; \
fi \
done && \
zabbix_revision=`git rev-parse --short HEAD` && \
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 && \
./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
@ -67,9 +80,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-java \
--enable-proxy \
--enable-server \
--enable-webservice \
--with-ares \
--with-ldap \
--with-libcurl \
--with-libmodbus \
@ -81,7 +96,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
--with-openssl \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
@ -93,7 +107,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
gzip -c database/${DB_TYPE}/create.sql > ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/create.sql.gz && \
rm -rf database/${DB_TYPE}/create.sql && \
mkdir /tmp/fonts/ && \
curl --tlsv1.2 -sSf -L "https://noto-website.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
curl --tlsv1.2 -sSf -L "https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
unzip /tmp/fonts/NotoSansCJKjp-hinted.zip -d /tmp/fonts/ && \
cp /tmp/fonts/NotoSansCJKjp-Regular.otf ${ZBX_SOURCES_DIR}/ui/assets/fonts/NotoSansCJKjp-Regular.ttf && \
cp /tmp/fonts/LICENSE_OFL.txt ${ZBX_SOURCES_DIR}/ui/assets/fonts/ && \
@ -109,19 +123,24 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
strip ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender && \
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf_template && \
cp -R ${ZBX_SOURCES_DIR}/conf/zabbix_agentd/ ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp /tmp/conf/agent/* ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf_template && \
cp /tmp/conf/agent2/* ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.d/ ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_server/zabbix_server ${ZBX_OUTPUT_DIR}/server/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf_template && \
cp /tmp/conf/server/* ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf_template && \
cp /tmp/conf/proxy/* ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/bin/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/lib/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service ${ZBX_OUTPUT_DIR}/web_service/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf_template && \
cp /tmp/conf/web_service/* ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get ${ZBX_OUTPUT_DIR}/general/bin/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender ${ZBX_OUTPUT_DIR}/general/bin/ && \
make -s distclean && \
@ -154,4 +173,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
make && \
strip /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
cd /tmp/ && \
git -c advice.detachedHead=false clone ${NVIDIA_GPU_PLUGIN_SOURCES} --branch ${NVIDIA_GPU_PLUGIN_VERSION} --depth 1 --single-branch /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
cd /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
make && \
strip /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/nvidia.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/

View File

@ -1,19 +1,18 @@
# syntax=docker/dockerfile:1
# escape=`
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-base:ltsc2022-agent-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} as builder
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
FROM ${BUILD_BASE_IMAGE} AS builder
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH=master
ARG ZABBIX_VERSION_RC_NUM=2400
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH
ENV ZBX_SOURCES=$ZBX_SOURCES MAJOR_VERSION=$MAJOR_VERSION ZBX_VERSION=$ZBX_VERSION GIT_BRANCH=${GIT_BRANCH:-$ZBX_VERSION} `
ZABBIX_VERSION_RC_NUM=$ZABBIX_VERSION_RC_NUM `
ZBX_SOURCES_DIR=C:\\zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=C:\\zabbix-${ZBX_VERSION}-output
@ -28,6 +27,8 @@ LABEL org.opencontainers.image.title="Zabbix agent build (Windows)" `
org.opencontainers.image.version="${ZBX_VERSION}" `
org.opencontainers.image.source="${ZBX_SOURCES}"
ADD config_templates C:\config_templates
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Set-Location -Path $env:SystemDrive\.; `
@ -35,21 +36,21 @@ RUN Set-Location -Path $env:SystemDrive\.; `
New-Item -ItemType directory -Path $env:SystemDrive\zabbix_src | Out-Null; `
New-Item -ItemType directory -Path $env:ZBX_OUTPUT_DIR | Out-Null; `
New-Item -ItemType directory -Path $env:ZBX_OUTPUT_DIR\sbin | Out-Null; `
New-Item -ItemType directory -Path $env:ZBX_OUTPUT_DIRt\bin | Out-Null; `
New-Item -ItemType directory -Path $env:ZBX_OUTPUT_DIR\bin | Out-Null; `
New-Item -ItemType directory -Path $env:ZBX_OUTPUT_DIR\conf | Out-Null; `
`
Import-Module (Get-ChildItem $env:VS_PATH -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=$env:BUILD_ARCH"""; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=x64"""; `
`
Write-Host ('Checkout GIT {0} ({1}) repository ...' -f $env:ZBX_SOURCES, $env:GIT_BRANCH); `
git -c advice.detachedHead=false clone $env:ZBX_SOURCES --branch $env:GIT_BRANCH --depth 1 --single-branch $env:ZBX_SOURCES_DIR; `
`
Write-Host ('Building Zabbix {0} version ...' -f $env:ZBX_VERSION); `
Write-Host ('Building Zabbix agent {0} version ...' -f $env:ZBX_VERSION); `
Set-Location -Path $env:ZBX_SOURCES_DIR; `
$ZbxRevision=(git rev-parse --short HEAD); `
(Get-Content include/version.h).replace('{ZABBIX_REVISION}', $ZbxRevision) | Set-Content include/version.h; `
Set-Location -Path $env:ZBX_SOURCES_DIR\build\win32\project; `
set CL=/MP; `
$env:CL = """$env:CL /MP /MT"""; `
nmake /S -f Makefile `
CPU=$env:CPU_MODEL `
CFLAGS="""/D CURL_STATICLIB /D HAVE_LIBCURL /I "$env:BUILD_OUTPUT\curl\include" /D ZABBIX_VERSION_REVISION=$ZbxRevision /D HAVE_LIBMODBUS_STATIC /D DEFAULT_CONFIG_FILE=$env:SystemDrive\zabbix\conf\zabbix_agentd.conf""" `
@ -60,7 +61,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
TLSLIBDIR=$env:BUILD_OUTPUT\openssl\lib `
MODBINCDIR=$env:BUILD_OUTPUT\libmodbus\include `
MODBLIBDIR=$env:BUILD_OUTPUT\libmodbus\lib `
LIBS="""$env:LIBS Crypt32.lib $env:BUILD_OUTPUT\curl\lib\libcurl_a.lib $env:BUILD_OUTPUT\zlib\lib\zlib.lib""" `
LIBS="""$env:LIBS Crypt32.lib $env:BUILD_OUTPUT\curl\lib\libcurl.lib $env:BUILD_OUTPUT\zlib\lib\zlibstatic.lib""" `
all; `
`
Write-Host 'Verifying build ("zabbix_agentd.exe -V") ...'; `
@ -70,5 +71,10 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Copy-Item -Path $env:ZBX_SOURCES_DIR\bin\win64\zabbix_agentd.exe $env:ZBX_OUTPUT_DIR\sbin; `
Copy-Item -Path $env:ZBX_SOURCES_DIR\bin\win64\zabbix_get.exe $env:ZBX_OUTPUT_DIR\bin; `
Copy-Item -Path $env:ZBX_SOURCES_DIR\bin\win64\zabbix_sender.exe $env:ZBX_OUTPUT_DIR\bin; `
Copy-Item -Path $env:ZBX_SOURCES_DIR\conf\zabbix_agentd.win.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agentd.conf; `
Copy-Item -Path $env:ZBX_SOURCES_DIR\conf\zabbix_agentd.win.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agentd.conf_template; `
Copy-Item -Recurse -Path $env:SystemDrive\config_templates\agent\* $env:ZBX_OUTPUT_DIR\conf\; `
nmake /S -f Makefile `
PCRE2INCDIR=$env:SystemDrive\build_output\pcre2\include `
PCRE2LIBDIR=$env:SystemDrive\build_output\pcre2\lib `
clean; `
Write-Host 'Zabbix binaries are compiled...';

View File

@ -1,28 +1,31 @@
# syntax=docker/dockerfile:1
# escape=`
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-base:ltsc2022-agent2-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} as builder
FROM ${BUILD_BASE_IMAGE} AS builder
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZABBIX_VERSION_RC_NUM=2400
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git
ARG POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git
ARG MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git
ARG EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git
ARG GIT_BRANCH=master
ARG NVIDIA_GPU_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/nvidia-gpu.git
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ENV ZBX_SOURCES=$ZBX_SOURCES MAJOR_VERSION=$MAJOR_VERSION ZBX_VERSION=$ZBX_VERSION GIT_BRANCH=${GIT_BRANCH:-$ZBX_VERSION} `
MONGODB_PLUGIN_SOURCES=$MONGODB_PLUGIN_SOURCES MONGODB_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
POSTGRESQL_PLUGIN_SOURCES=$POSTGRESQL_PLUGIN_SOURCES POSTGRESQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
MSSQL_PLUGIN_SOURCES=$MSSQL_PLUGIN_SOURCES MSSQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
EMBER_PLUS_PLUGIN_SOURCES=$EMBER_PLUS_PLUGIN_SOURCES EMBER_PLUS_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
MONGODB_PLUGIN_SOURCES=$MONGODB_PLUGIN_SOURCES MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
POSTGRESQL_PLUGIN_SOURCES=$POSTGRESQL_PLUGIN_SOURCES POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
MSSQL_PLUGIN_SOURCES=$MSSQL_PLUGIN_SOURCES MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
EMBER_PLUS_PLUGIN_SOURCES=$EMBER_PLUS_PLUGIN_SOURCES EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
NVIDIA_GPU_PLUGIN_SOURCES=$NVIDIA_GPU_PLUGIN_SOURCES NVIDIA_GPU_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
ZABBIX_VERSION_RC_NUM=$ZABBIX_VERSION_RC_NUM `
ZBX_SOURCES_DIR=C:\\zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=C:\\zabbix-${ZBX_VERSION}-output
@ -36,6 +39,10 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build (Windows)" `
org.opencontainers.image.version="${ZBX_VERSION}" `
org.opencontainers.image.source="${ZBX_SOURCES}"
ADD config_templates C:\config_templates
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Set-Location -Path $env:SystemDrive\.; `
`
New-Item -ItemType directory -Path $env:ZBX_SOURCES_DIR | Out-Null; `
@ -46,12 +53,12 @@ RUN Set-Location -Path $env:SystemDrive\.; `
New-Item -ItemType directory -Path $env:ZBX_OUTPUT_DIR\zabbix-agent2-plugin | Out-Null; `
`
Import-Module (Get-ChildItem $env:VS_PATH -Recurse -File -Filter Microsoft.VisualStudio.DevShell.dll).FullName; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=$env:BUILD_ARCH"""; `
Enter-VsDevShell -VsInstallPath $env:VS_PATH -SkipAutomaticLocation -DevCmdArguments """-arch=x64"""; `
`
Write-Host ('Checkout GIT {0} ({1}) repository ...' -f $env:ZBX_SOURCES, $env:GIT_BRANCH); `
git -c advice.detachedHead=false clone $env:ZBX_SOURCES --branch $env:GIT_BRANCH --depth 1 --single-branch $env:ZBX_SOURCES_DIR; `
`
Write-Host ('Building Zabbix {0} version ...' -f $env:ZBX_VERSION); `
Write-Host ('Building Zabbix agent 2 {0} version ...' -f $env:ZBX_VERSION); `
Set-Location -Path $env:ZBX_SOURCES_DIR; `
$ZbxRevision=(git rev-parse --short HEAD); `
(Get-Content include\version.h).replace('{ZABBIX_REVISION}', $ZbxRevision) | Set-Content include\version.h; `
@ -68,8 +75,9 @@ RUN Set-Location -Path $env:SystemDrive\.; `
dumpbin /dependents $env:ZBX_SOURCES_DIR\bin\win64\zabbix_agent2.exe; `
`
Copy-Item -Path $env:ZBX_SOURCES_DIR\bin\win64\zabbix_agent2.exe $env:ZBX_OUTPUT_DIR\sbin; `
Copy-Item -Path $env:ZBX_SOURCES_DIR\src\go\conf\zabbix_agent2.win.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agent2.conf; `
Copy-Item -Path $env:ZBX_SOURCES_DIR\src\go\conf\zabbix_agent2.win.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agent2.conf_template; `
Copy-Item -Recurse -Path $env:ZBX_SOURCES_DIR\src\go\conf\zabbix_agent2.d $env:ZBX_OUTPUT_DIR\conf\zabbix_agent2.d; `
Copy-Item -Recurse -Path $env:SystemDrive\config_templates\agent2\* $env:ZBX_OUTPUT_DIR\conf; `
mingw32-make -s clean; `
`
Write-Host ('Building Zabbix MongoDB plugin {0} version ...' -f $env:MONGODB_PLUGIN_VERSION); `
@ -108,7 +116,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Copy-Item -Path $env:SystemDrive\mssql-plugin-$env:MSSQL_PLUGIN_VERSION\mssql.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agent2.d\plugins.d; `
mingw32-make -s clean; `
`
Write-Host ('Building Zabbix Ember+ plugin {0} version ...' -f $env:EMBER_PLUS_PLUGIN_VERSION); `
git -c advice.detachedHead=false clone $env:EMBER_PLUS_PLUGIN_SOURCES --branch $env:EMBER_PLUS_PLUGIN_VERSION --depth 1 --single-branch $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION; `
Set-Location -Path $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION; `
@ -120,4 +127,16 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Copy-Item -Path $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION\zabbix-agent2-plugin-ember-plus.exe $env:ZBX_OUTPUT_DIR\zabbix-agent2-plugin\ember-plus.exe; `
Copy-Item -Path $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION\ember.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agent2.d\plugins.d; `
mingw32-make -s clean; `
`
Write-Host ('Building NVIDIA GPU plugin {0} version ...' -f $env:NVIDIA_GPU_PLUGIN_VERSION); `
git -c advice.detachedHead=false clone $env:NVIDIA_GPU_PLUGIN_SOURCES --branch $env:NVIDIA_GPU_PLUGIN_VERSION --depth 1 --single-branch $env:SystemDrive\nvidia-gpu-plugin-$env:NVIDIA_GPU_PLUGIN_VERSION; `
Set-Location -Path $env:SystemDrive\nvidia-gpu-plugin-$env:NVIDIA_GPU_PLUGIN_VERSION; `
mingw32-make; `
`
Write-Host 'Verifying NVIDIA GPU plugin ("zabbix-agent2-plugin-nvidia-gpu.exe -V") ...'; `
& $env:SystemDrive\nvidia-gpu-plugin-$env:NVIDIA_GPU_PLUGIN_VERSION\zabbix-agent2-plugin-nvidia-gpu.exe -V; `
`
Copy-Item -Path $env:SystemDrive\nvidia-gpu-plugin-$env:NVIDIA_GPU_PLUGIN_VERSION\zabbix-agent2-plugin-nvidia-gpu.exe $env:ZBX_OUTPUT_DIR\zabbix-agent2-plugin\nvidia-gpu.exe; `
Copy-Item -Path $env:SystemDrive\nvidia-gpu-plugin-$env:NVIDIA_GPU_PLUGIN_VERSION\nvidia.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agent2.d\plugins.d; `
mingw32-make -s clean; `
Write-Host 'Zabbix binaries are compiled...';

View File

@ -1,28 +1,30 @@
# syntax=docker/dockerfile:1
# escape=`
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.0
ARG BUILD_BASE_IMAGE=zabbix-build-base:ltsc2022-agent2-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} as builder
FROM ${BUILD_BASE_IMAGE} AS builder
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.0
ARG ZABBIX_VERSION_RC_NUM=2400
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git
ARG POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git
ARG MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git
ARG EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git
ARG GIT_BRANCH=master
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ENV ZBX_SOURCES=$ZBX_SOURCES MAJOR_VERSION=$MAJOR_VERSION ZBX_VERSION=$ZBX_VERSION GIT_BRANCH=${GIT_BRANCH:-$ZBX_VERSION} `
MONGODB_PLUGIN_SOURCES=$MONGODB_PLUGIN_SOURCES MONGODB_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
POSTGRESQL_PLUGIN_SOURCES=$POSTGRESQL_PLUGIN_SOURCES POSTGRESQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
MSSQL_PLUGIN_SOURCES=$MSSQL_PLUGIN_SOURCES MSSQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
EMBER_PLUS_PLUGIN_SOURCES=$EMBER_PLUS_PLUGIN_SOURCES EMBER_PLUS_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
MONGODB_PLUGIN_SOURCES=$MONGODB_PLUGIN_SOURCES MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
POSTGRESQL_PLUGIN_SOURCES=$POSTGRESQL_PLUGIN_SOURCES POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
MSSQL_PLUGIN_SOURCES=$MSSQL_PLUGIN_SOURCES MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
EMBER_PLUS_PLUGIN_SOURCES=$EMBER_PLUS_PLUGIN_SOURCES EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
ZABBIX_VERSION_RC_NUM=$ZABBIX_VERSION_RC_NUM `
ZBX_SOURCES_DIR=C:\\zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=C:\\zabbix-${ZBX_VERSION}-output
@ -108,7 +110,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Copy-Item -Path $env:SystemDrive\mssql-plugin-$env:MSSQL_PLUGIN_VERSION\mssql.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agent2.d\plugins.d; `
mingw32-make -s clean; `
`
Write-Host ('Building Zabbix Ember+ plugin {0} version ...' -f $env:EMBER_PLUS_PLUGIN_VERSION); `
git -c advice.detachedHead=false clone $env:EMBER_PLUS_PLUGIN_SOURCES --branch $env:EMBER_PLUS_PLUGIN_VERSION --depth 1 --single-branch $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION; `
Set-Location -Path $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION; `

View File

@ -1,28 +1,30 @@
# syntax=docker/dockerfile:1
# escape=`
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.0
ARG BUILD_BASE_IMAGE=zabbix-build-base:ltsc2022-agent2-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} as builder
FROM ${BUILD_BASE_IMAGE} AS builder
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.0
ARG ZABBIX_VERSION_RC_NUM=2400
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git
ARG POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git
ARG MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git
ARG EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git
ARG GIT_BRANCH=master
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ENV ZBX_SOURCES=$ZBX_SOURCES MAJOR_VERSION=$MAJOR_VERSION ZBX_VERSION=$ZBX_VERSION GIT_BRANCH=${GIT_BRANCH:-$ZBX_VERSION} `
MONGODB_PLUGIN_SOURCES=$MONGODB_PLUGIN_SOURCES MONGODB_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
POSTGRESQL_PLUGIN_SOURCES=$POSTGRESQL_PLUGIN_SOURCES POSTGRESQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
MSSQL_PLUGIN_SOURCES=$MSSQL_PLUGIN_SOURCES MSSQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
EMBER_PLUS_PLUGIN_SOURCES=$EMBER_PLUS_PLUGIN_SOURCES EMBER_PLUS_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} `
MONGODB_PLUGIN_SOURCES=$MONGODB_PLUGIN_SOURCES MONGODB_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
POSTGRESQL_PLUGIN_SOURCES=$POSTGRESQL_PLUGIN_SOURCES POSTGRESQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
MSSQL_PLUGIN_SOURCES=$MSSQL_PLUGIN_SOURCES MSSQL_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
EMBER_PLUS_PLUGIN_SOURCES=$EMBER_PLUS_PLUGIN_SOURCES EMBER_PLUS_PLUGIN_VERSION=${ZBX_PLUGINS_VERSION} `
ZABBIX_VERSION_RC_NUM=$ZABBIX_VERSION_RC_NUM `
ZBX_SOURCES_DIR=C:\\zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=C:\\zabbix-${ZBX_VERSION}-output
@ -109,7 +111,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Copy-Item -Path $env:SystemDrive\mssql-plugin-$env:MSSQL_PLUGIN_VERSION\mssql.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agent2.d\plugins.d; `
mingw32-make -s clean; `
`
Write-Host ('Building Zabbix Ember+ plugin {0} version ...' -f $env:EMBER_PLUS_PLUGIN_VERSION); `
git -c advice.detachedHead=false clone $env:EMBER_PLUS_PLUGIN_SOURCES --branch $env:EMBER_PLUS_PLUGIN_VERSION --depth 1 --single-branch $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION; `
Set-Location -Path $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION; `

View File

@ -0,0 +1,28 @@
# This is a configuration file for Zabbix agent service (Windows)
# To get more information about Zabbix, visit https://www.zabbix.com
############ ADVANCED PARAMETERS #################
### Option: Include
# You may include individual files in the configuration file.
#
# Mandatory: no
# Default:
# Include=
# Include=c:\zabbix\zabbix_agentd.userparams.conf
# Include=c:\zabbix\zabbix_agentd.conf.d\
# Include=c:\zabbix\zabbix_agentd.conf.d\*.conf
Include=C:\zabbix\conf\zabbix_agentd_active_checks.conf
Include=C:\zabbix\conf\zabbix_agentd_aliases.conf
Include=C:\zabbix\conf\zabbix_agentd_item_keys.conf
Include=C:\zabbix\conf\zabbix_agentd_logging.conf
Include=C:\zabbix\conf\zabbix_agentd_network.conf
Include=C:\zabbix\conf\zabbix_agentd_passive_checks.conf
Include=C:\zabbix\conf\zabbix_agentd_perf_counters.conf
Include=C:\zabbix\conf\zabbix_agentd_timeouts.conf
Include=C:\zabbix\conf\zabbix_agentd_tls.conf
Include=C:\zabbix\conf\zabbix_agentd_user_parameters.conf
Include=C:\zabbix\conf\zabbix_agentd.d\*.conf

View File

@ -0,0 +1,157 @@
##### Active checks related
### Option: ServerActive
# Zabbix server/proxy address or cluster configuration to get active checks from.
# Server/proxy address is IP address or DNS name and optional port separated by colon.
# Cluster configuration is one or more server addresses separated by semicolon.
# Multiple Zabbix servers/clusters and Zabbix proxies can be specified, separated by comma.
# More than one Zabbix proxy should not be specified from each Zabbix server/cluster.
# If Zabbix proxy is specified then Zabbix server/cluster for that proxy should not be specified.
# Multiple comma-delimited addresses can be provided to use several independent Zabbix servers in parallel. Spaces are allowed.
# If port is not specified, default port is used.
# IPv6 addresses must be enclosed in square brackets if port for that host is specified.
# If port is not specified, square brackets for IPv6 addresses are optional.
# If this parameter is not specified, active checks are disabled.
# Example for Zabbix proxy:
# ServerActive=127.0.0.1:10051
# Example for multiple servers:
# ServerActive=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1]
# Example for high availability:
# ServerActive=zabbix.cluster.node1;zabbix.cluster.node2:20051;zabbix.cluster.node3
# Example for high availability with two clusters and one server:
# ServerActive=zabbix.cluster.node1;zabbix.cluster.node2:20051,zabbix.cluster2.node1;zabbix.cluster2.node2,zabbix.domain
#
# Mandatory: no
# Default:
# ServerActive=
ServerActive=${ZBX_ACTIVESERVERS}
### Option: Hostname
# List of comma delimited unique, case sensitive hostnames.
# Required for active checks and must match hostnames as configured on the server.
# Value is acquired from HostnameItem if undefined.
#
# Mandatory: no
# Default:
# Hostname=
Hostname=${ZBX_HOSTNAME}
### Option: HostnameItem
# Item used for generating Hostname if it is undefined. Ignored if Hostname is defined.
# Does not support UserParameters or aliases.
#
# Mandatory: no
# Default:
# HostnameItem=system.hostname
HostnameItem=${ZBX_HOSTNAMEITEM}
### Option: HostMetadata
# Optional parameter that defines host metadata.
# Host metadata is used at host auto-registration process.
# An agent will issue an error and not start if the value is over limit of 2034 bytes.
# If not defined, value will be acquired from HostMetadataItem.
#
# Mandatory: no
# Range: 0-2034 bytes
# Default:
# HostMetadata=
HostMetadata=${ZBX_METADATA}
### Option: HostMetadataItem
# Optional parameter that defines an item used for getting host metadata.
# Host metadata is used at host auto-registration process.
# During an auto-registration request an agent will log a warning message if
# the value returned by specified item is over limit of 65535 characters.
# This option is only used when HostMetadata is not defined.
#
# Mandatory: no
# Default:
# HostMetadataItem=
HostMetadataItem=${ZBX_METADATAITEM}
### Option: HostInterface
# Optional parameter that defines host interface.
# Host interface is used at host auto-registration process.
# An agent will issue an error and not start if the value is over limit of 255 characters.
# If not defined, value will be acquired from HostInterfaceItem.
#
# Mandatory: no
# Range: 0-255 characters
# Default:
# HostInterface=
HostInterface=${ZBX_HOSTINTERFACE}
### Option: HostInterfaceItem
# Optional parameter that defines an item used for getting host interface.
# Host interface is used at host auto-registration process.
# During an auto-registration request an agent will log a warning message if
# the value returned by specified item is over limit of 255 characters.
# This option is only used when HostInterface is not defined.
#
# Mandatory: no
# Default:
# HostInterfaceItem=
HostInterfaceItem=${ZBX_HOSTINTERFACEITEM}
### Option: RefreshActiveChecks
# How often list of active checks is refreshed, in seconds.
#
# Mandatory: no
# Range: 1-86400
# Default:
# RefreshActiveChecks=5
RefreshActiveChecks=${ZBX_REFRESHACTIVECHECKS}
### Option: BufferSend
# Do not keep data longer than N seconds in buffer.
#
# Mandatory: no
# Range: 1-3600
# Default:
# BufferSend=5
BufferSend=${ZBX_BUFFERSEND}
### Option: BufferSize
# Maximum number of values in a memory buffer. The agent will send
# all collected data to Zabbix Server or Proxy if the buffer is full.
#
# Mandatory: no
# Range: 2-65535
# Default:
# BufferSize=100
BufferSize=${ZBX_BUFFERSIZE}
### Option: MaxLinesPerSecond
# Maximum number of new lines the agent will send per second to Zabbix Server
# or Proxy processing 'log' and 'logrt' active checks.
# The provided value will be overridden by the parameter 'maxlines',
# provided in 'log' or 'logrt' item keys.
#
# Mandatory: no
# Range: 1-1000
# Default:
# MaxLinesPerSecond=20
MaxLinesPerSecond=${ZBX_MAXLINESPERSECOND}
### Option: HeartbeatFrequency
# Frequency of heartbeat messages in seconds.
# Used for monitoring availability of active checks.
# 0 - heartbeat messages disabled.
#
# Mandatory: no
# Range: 0-3600
# Default: 60
# HeartbeatFrequency=
HeartbeatFrequency=${ZBX_HEARTBEATFREQUENCY}

View File

@ -0,0 +1,12 @@
### Option: Alias
# Sets an alias for an item key. It can be used to substitute long and complex item key with a smaller and simpler one.
# Multiple Alias parameters may be present. Multiple parameters with the same Alias key are not allowed.
# Different Alias keys may reference the same item key.
# For example, to retrieve paging file usage in percents from the server:
# Alias=pg_usage:perf_counter[\Paging File(_Total)\% Usage]
# Now shorthand key pg_usage may be used to retrieve data.
# Aliases can be used in HostMetadataItem but not in HostnameItem or PerfCounter parameters.
#
# Mandatory: no
# Range:
# Default:

View File

@ -0,0 +1,20 @@
### Option: AllowKey
# Allow execution of item keys matching pattern.
# Multiple keys matching rules may be defined in combination with DenyKey.
# Key pattern is wildcard expression, which support "*" character to match any number of any characters in certain position. It might be used in both key name and key arguments.
# Parameters are processed one by one according their appearance order.
# If no AllowKey or DenyKey rules defined, all keys are allowed.
#
# Mandatory: no
### Option: DenyKey
# Deny execution of items keys matching pattern.
# Multiple keys matching rules may be defined in combination with AllowKey.
# Key pattern is wildcard expression, which support "*" character to match any number of any characters in certain position. It might be used in both key name and key arguments.
# Parameters are processed one by one according their appearance order.
# If no AllowKey or DenyKey rules defined, all keys are allowed.
# Unless another system.run[*] rule is specified DenyKey=system.run[*] is added by default.
#
# Mandatory: no
# Default:
# DenyKey=system.run[*]

View File

@ -0,0 +1,38 @@
### Option: LogType
# Specifies where log messages are written to:
# system - syslog
# file - file specified with LogFile parameter
# console - standard output
#
# Mandatory: no
# Default:
# LogType=file
LogType=console
### Option: DebugLevel
# Specifies debug level:
# 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)
#
# Mandatory: no
# Range: 0-5
# Default:
# DebugLevel=3
DebugLevel=${ZBX_DEBUGLEVEL}
### Option: LogRemoteCommands
# Enable logging of executed shell commands as warnings.
# 0 - disabled
# 1 - enabled
#
# Mandatory: no
# Default:
# LogRemoteCommands=0
LogRemoteCommands=${ZBX_LOGREMOTECOMMANDS}

View File

@ -0,0 +1,41 @@
### Option: ListenPort
# Agent will listen on this port for connections from the server.
#
# Mandatory: no
# Range: 1024-32767
# Default:
# ListenPort=10050
ListenPort=${ZBX_LISTENPORT}
### Option: ListenIP
# List of comma delimited IP addresses that the agent should listen on.
# First IP address is sent to Zabbix server if connecting to it to retrieve list of active checks.
#
# Mandatory: no
# Default:
# ListenIP=0.0.0.0
ListenIP=${ZBX_LISTENIP}
### Option: SourceIP
# Source IP address for outgoing connections.
#
# Mandatory: no
# Default:
# SourceIP=
SourceIP=${ZBX_SOURCEIP}
####### For advanced users - TCP-related fine-tuning parameters #######
## Option: ListenBacklog
# The maximum number of pending connections in the queue. This parameter is passed to
# listen() function as argument 'backlog' (see "man listen").
#
# Mandatory: no
# Range: 0 - INT_MAX (depends on system, too large values may be silently truncated to implementation-specified maximum)
# Default: SOMAXCONN (hard-coded constant, depends on system)
# ListenBacklog=
ListenBacklog=${ZBX_LISTENBACKLOG}

View File

@ -0,0 +1,26 @@
##### Passive checks related
### Option: Server
# List of comma delimited IP addresses, optionally in CIDR notation, or DNS names of Zabbix servers and Zabbix proxies.
# Incoming connections will be accepted only from the hosts listed here.
# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally
# and '::/0' will allow any IPv4 or IPv6 address.
# '0.0.0.0/0' can be used to allow any IPv4 address.
# Example: Server=127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.example.com
#
# Mandatory: yes, if StartAgents is not explicitly set to 0
# Default:
# Server=
Server=${ZBX_PASSIVESERVERS}
### Option: StartAgents
# Number of pre-forked instances of zabbix_agentd that process passive checks.
# If set to 0, disables passive checks and the agent will not listen on any TCP port.
#
# Mandatory: no
# Range: 0-100
# Default:
# StartAgents=10
StartAgents=${ZBX_STARTAGENTS}

View File

@ -0,0 +1,12 @@
### Option: PerfCounter
# Syntax: <parameter_name>,"<perf_counter_path>",<period>
# Defines new parameter <parameter_name> which is an average value for system performance counter <perf_counter_path> for the specified time period <period> (in seconds).
# For example, if you wish to receive average number of processor interrupts per second for last minute, you can define new parameter "interrupts" as following:
# PerfCounter = interrupts,"\Processor(0)\Interrupts/sec",60
# Please note double quotes around performance counter path.
# Samples for calculating average value will be taken every second.
# You may run "typeperf -qx" to get list of all performance counters available in Windows.
#
# Mandatory: no
# Range:
# Default:

View File

@ -0,0 +1,9 @@
### Option: Timeout
# Specifies how long to wait (in seconds) for establishing connection and exchanging data with Zabbix proxy or server.
#
# Mandatory: no
# Range: 1-30
# Default:
# Timeout=3
Timeout=${ZBX_TIMEOUT}

View File

@ -0,0 +1,178 @@
####### TLS-RELATED PARAMETERS #######
### Option: TLSConnect
# How the agent should connect to server or proxy. Used for active checks.
# Only one value can be specified:
# unencrypted - connect without encryption
# psk - connect using TLS and a pre-shared key
# cert - connect using TLS and a certificate
#
# Mandatory: yes, if TLS certificate or PSK parameters are defined (even for 'unencrypted' connection)
# Default:
# TLSConnect=unencrypted
TLSConnect=${ZBX_TLSCONNECT}
### Option: TLSAccept
# What incoming connections to accept.
# Multiple values can be specified, separated by comma:
# unencrypted - accept connections without encryption
# psk - accept connections secured with TLS and a pre-shared key
# cert - accept connections secured with TLS and a certificate
#
# Mandatory: yes, if TLS certificate or PSK parameters are defined (even for 'unencrypted' connection)
# Default:
# TLSAccept=unencrypted
TLSAccept=${ZBX_TLSACCEPT}
### Option: TLSCAFile
# Full pathname of a file containing the top-level CA(s) certificates for
# peer certificate verification.
#
# Mandatory: no
# Default:
# TLSCAFile=
TLSCAFile=${ZBX_TLSCAFILE}
### Option: TLSCRLFile
# Full pathname of a file containing revoked certificates.
#
# Mandatory: no
# Default:
# TLSCRLFile=
TLSCRLFile=${ZBX_TLSCRLFILE}
### Option: TLSServerCertIssuer
# Allowed server certificate issuer.
#
# Mandatory: no
# Default:
# TLSServerCertIssuer=
TLSServerCertIssuer=${ZBX_TLSSERVERCERTISSUER}
### Option: TLSServerCertSubject
# Allowed server certificate subject.
#
# Mandatory: no
# Default:
# TLSServerCertSubject=
TLSServerCertSubject=${ZBX_TLSSERVERCERTSUBJECT}
### Option: TLSCertFile
# Full pathname of a file containing the agent certificate or certificate chain.
#
# Mandatory: no
# Default:
# TLSCertFile=
TLSCertFile=${ZBX_TLSCERTFILE}
### Option: TLSKeyFile
# Full pathname of a file containing the agent private key.
#
# Mandatory: no
# Default:
# TLSKeyFile=
TLSKeyFile=${ZBX_TLSKEYFILE}
### Option: TLSPSKIdentity
# Unique, case sensitive string used to identify the pre-shared key.
#
# Mandatory: no
# Default:
# TLSPSKIdentity=
TLSPSKIdentity=${ZBX_TLSPSKIDENTITY}
### Option: TLSPSKFile
# Full pathname of a file containing the pre-shared key.
#
# Mandatory: no
# Default:
# TLSPSKFile=
TLSPSKFile=${ZBX_TLSPSKFILE}
####### For advanced users - TLS ciphersuite selection criteria #######
### Option: TLSCipherCert13
# Cipher string for OpenSSL 1.1.1 or newer in TLS 1.3.
# Override the default ciphersuite selection criteria for certificate-based encryption.
#
# Mandatory: no
# Default:
# TLSCipherCert13=
TLSCipherCert13=${ZBX_TLSCIPHERCERT13}
### Option: TLSCipherCert
# GnuTLS priority string or OpenSSL (TLS 1.2) cipher string.
# Override the default ciphersuite selection criteria for certificate-based encryption.
# Example for GnuTLS:
# NONE:+VERS-TLS1.2:+ECDHE-RSA:+RSA:+AES-128-GCM:+AES-128-CBC:+AEAD:+SHA256:+SHA1:+CURVE-ALL:+COMP-NULL:+SIGN-ALL:+CTYPE-X.509
# Example for OpenSSL:
# EECDH+aRSA+AES128:RSA+aRSA+AES128
#
# Mandatory: no
# Default:
# TLSCipherCert=
TLSCipherCert=${ZBX_TLSCIPHERCERT}
### Option: TLSCipherPSK13
# Cipher string for OpenSSL 1.1.1 or newer in TLS 1.3.
# Override the default ciphersuite selection criteria for PSK-based encryption.
# Example:
# TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256
#
# Mandatory: no
# Default:
# TLSCipherPSK13=
TLSCipherPSK13=${ZBX_TLSCIPHERPSK13}
### Option: TLSCipherPSK
# GnuTLS priority string or OpenSSL (TLS 1.2) cipher string.
# Override the default ciphersuite selection criteria for PSK-based encryption.
# Example for GnuTLS:
# NONE:+VERS-TLS1.2:+ECDHE-PSK:+PSK:+AES-128-GCM:+AES-128-CBC:+AEAD:+SHA256:+SHA1:+CURVE-ALL:+COMP-NULL:+SIGN-ALL
# Example for OpenSSL:
# kECDHEPSK+AES128:kPSK+AES128
#
# Mandatory: no
# Default:
# TLSCipherPSK=
TLSCipherPSK=${ZBX_TLSCIPHERPSK}
### Option: TLSCipherAll13
# Cipher string for OpenSSL 1.1.1 or newer in TLS 1.3.
# Override the default ciphersuite selection criteria for certificate- and PSK-based encryption.
# Example:
# TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256
#
# Mandatory: no
# Default:
# TLSCipherAll13=
TLSCipherAll13=${ZBX_TLSCIPHERALL13}
### Option: TLSCipherAll
# GnuTLS priority string or OpenSSL (TLS 1.2) cipher string.
# Override the default ciphersuite selection criteria for certificate- and PSK-based encryption.
# Example for GnuTLS:
# NONE:+VERS-TLS1.2:+ECDHE-RSA:+RSA:+ECDHE-PSK:+PSK:+AES-128-GCM:+AES-128-CBC:+AEAD:+SHA256:+SHA1:+CURVE-ALL:+COMP-NULL:+SIGN-ALL:+CTYPE-X.509
# Example for OpenSSL:
# EECDH+aRSA+AES128:RSA+aRSA+AES128:kECDHEPSK+AES128:kPSK+AES128
#
# Mandatory: no
# Default:
# TLSCipherAll=
TLSCipherAll=${ZBX_TLSCIPHERALL}

View File

@ -0,0 +1,35 @@
####### USER-DEFINED MONITORED PARAMETERS #######
### Option: UnsafeUserParameters
# Allow all characters to be passed in arguments to user-defined parameters.
# The following characters are not allowed:
# \ ' " ` * ? [ ] { } ~ $ ! & ; ( ) < > | # @
# Additionally, newline characters are not allowed.
# 0 - do not allow
# 1 - allow
#
# Mandatory: no
# Range: 0-1
# Default:
# UnsafeUserParameters=0
UnsafeUserParameters=${ZBX_UNSAFEUSERPARAMETERS}
### Option: UserParameter
# User-defined parameter to monitor. There can be several user-defined parameters.
# Format: UserParameter=<key>,<shell command>
# See 'zabbix_agentd' directory for examples.
#
# Mandatory: no
# Default:
# UserParameter=
### Option: UserParameterDir
# Directory to execute UserParameter commands from. Only one entry is allowed.
# When executing UserParameter commands the agent will change the working directory to the one
# specified in the UserParameterDir option.
# This way UserParameter commands can be specified using the relative ./ prefix.
#
# Mandatory: no
# Default:
# UserParameterDir=

View File

@ -0,0 +1,43 @@
# This is a configuration file for Zabbix agent 2 (Windows)
# To get more information about Zabbix, visit https://www.zabbix.com
### Option: Include
# You may include individual files or all files in a directory in the configuration file.
# Installing Zabbix will create include directory in /usr/local/etc, unless modified during the compile time.
#
# Mandatory: no
# Default:
# Include=
# Include=c:\zabbix\zabbix_agent2.userparams.conf
# Include=c:\zabbix\zabbix_agent2.conf.d\
# Include=c:\zabbix\zabbix_agent2.conf.d\*.conf
Include=C:\zabbix\conf\zabbix_agent2_active_checks.conf
Include=C:\zabbix\conf\zabbix_agent2_aliases.conf
Include=C:\zabbix\conf\zabbix_agent2_item_keys.conf
Include=C:\zabbix\conf\zabbix_agent2_locations.conf
Include=C:\zabbix\conf\zabbix_agent2_logging.conf
Include=C:\zabbix\conf\zabbix_agent2_network.conf
Include=C:\zabbix\conf\zabbix_agent2_passive_checks.conf
Include=C:\zabbix\conf\zabbix_agent2_timeouts.conf
Include=C:\zabbix\conf\zabbix_agent2_tls.conf
Include=C:\zabbix\conf\zabbix_agent2_user_parameters.conf
Include=C:\zabbix\conf\zabbix_agentd.d\*.conf
Include=C:\zabbix\conf\zabbix_agent2.d\*.conf
####### PLUGIN-SPECIFIC PARAMETERS #######
### Option: Plugins
# A plugin can have one or more plugin specific configuration parameters in format:
# Plugins.<PluginName>.<Parameter1>=<value1>
# Plugins.<PluginName>.<Parameter2>=<value2>
#
# Mandatory: no
# Range:
# Default:
# Include configuration files for plugins
Include=C:\zabbix\conf\zabbix_agent2.d\plugins.d\*.conf

View File

@ -0,0 +1,213 @@
##### Active checks related
### Option: ServerActive
# Zabbix server/proxy address or cluster configuration to get active checks from.
# Server/proxy address is IP address or DNS name and optional port separated by colon.
# Cluster configuration is one or more server addresses separated by semicolon.
# Multiple Zabbix servers/clusters and Zabbix proxies can be specified, separated by comma.
# More than one Zabbix proxy should not be specified from each Zabbix server/cluster.
# If Zabbix proxy is specified then Zabbix server/cluster for that proxy should not be specified.
# Multiple comma-delimited addresses can be provided to use several independent Zabbix servers in parallel. Spaces are allowed.
# If port is not specified, default port is used.
# IPv6 addresses must be enclosed in square brackets if port for that host is specified.
# If port is not specified, square brackets for IPv6 addresses are optional.
# If this parameter is not specified, active checks are disabled.
# Example for Zabbix proxy:
# ServerActive=127.0.0.1:10051
# Example for multiple servers:
# ServerActive=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1]
# Example for high availability:
# ServerActive=zabbix.cluster.node1;zabbix.cluster.node2:20051;zabbix.cluster.node3
# Example for high availability with two clusters and one server:
# ServerActive=zabbix.cluster.node1;zabbix.cluster.node2:20051,zabbix.cluster2.node1;zabbix.cluster2.node2,zabbix.domain
#
# Mandatory: no
# Default:
# ServerActive=
ServerActive=${ZBX_ACTIVESERVERS}
### Option: Hostname
# List of comma delimited unique, case sensitive hostnames.
# Required for active checks and must match hostnames as configured on the server.
# Value is acquired from HostnameItem if undefined.
#
# Mandatory: no
# Default:
# Hostname=
Hostname=${ZBX_HOSTNAME}
### Option: HostnameItem
# Item used for generating Hostname if it is undefined. Ignored if Hostname is defined.
# Does not support UserParameters or aliases.
#
# Mandatory: no
# Default:
# HostnameItem=system.hostname
HostnameItem=${ZBX_HOSTNAMEITEM}
### Option: HostMetadata
# Optional parameter that defines host metadata.
# Host metadata is used at host auto-registration process.
# An agent will issue an error and not start if the value is over limit of 2034 bytes.
# If not defined, value will be acquired from HostMetadataItem.
#
# Mandatory: no
# Range: 0-2034 bytes
# Default:
# HostMetadata=
HostMetadata=${ZBX_METADATA}
### Option: HostMetadataItem
# Optional parameter that defines an item used for getting host metadata.
# Host metadata is used at host auto-registration process.
# During an auto-registration request an agent will log a warning message if
# the value returned by specified item is over limit of 65535 characters.
# This option is only used when HostMetadata is not defined.
#
# Mandatory: no
# Default:
# HostMetadataItem=
HostMetadataItem=${ZBX_METADATAITEM}
### Option: HostInterface
# Optional parameter that defines host interface.
# Host interface is used at host auto-registration process.
# An agent will issue an error and not start if the value is over limit of 255 characters.
# If not defined, value will be acquired from HostInterfaceItem.
#
# Mandatory: no
# Range: 0-255 characters
# Default:
# HostInterface=
HostInterface=${ZBX_HOSTINTERFACE}
### Option: HostInterfaceItem
# Optional parameter that defines an item used for getting host interface.
# Host interface is used at host auto-registration process.
# During an auto-registration request an agent will log a warning message if
# the value returned by specified item is over limit of 255 characters.
# This option is only used when HostInterface is not defined.
#
# Mandatory: no
# Default:
# HostInterfaceItem=
HostInterfaceItem=${ZBX_HOSTINTERFACEITEM}
### Option: RefreshActiveChecks
# How often list of active checks is refreshed, in seconds.
#
# Mandatory: no
# Range: 1-86400
# Default:
# RefreshActiveChecks=5
RefreshActiveChecks=${ZBX_REFRESHACTIVECHECKS}
### Option: BufferSend
# Do not keep data longer than N seconds in buffer.
#
# Mandatory: no
# Range: 1-3600
# Default:
# BufferSend=5
BufferSend=${ZBX_BUFFERSEND}
### Option: BufferSize
# Maximum number of values in a memory buffer. The agent will send
# all collected data to Zabbix Server or Proxy if the buffer is full.
#
# Mandatory: no
# Range: 2-65535
# Default:
# BufferSize=1000
BufferSize=${ZBX_BUFFERSIZE}
### Option: EnablePersistentBuffer
# Enable usage of local persistent storage for active items.
# 0 - disabled, in-memory buffer is used (default); 1 - use persistent buffer
# Mandatory: no
# Range: 0-1
# Default:
# EnablePersistentBuffer=0
EnablePersistentBuffer=${ZBX_ENABLEPERSISTENTBUFFER}
### Option: PersistentBufferPeriod
# Zabbix Agent2 will keep data for this time period in case of no
# connectivity with Zabbix server or proxy. Older data will be lost. Log data will be preserved.
# Option is valid if EnablePersistentBuffer=1
#
# Mandatory: no
# Range: 1m-365d
# Default:
# PersistentBufferPeriod=1h
PersistentBufferPeriod=${ZBX_PERSISTENTBUFFERPERIOD}
### Option: PersistentBufferFile
# Full filename. Zabbix Agent2 will keep SQLite database in this file.
# Option is valid if EnablePersistentBuffer=1
#
# Mandatory: no
# Default:
# PersistentBufferFile=
PersistentBufferFile=${ZBX_PERSISTENTBUFFERFILE}
### Option: Plugins.Log.MaxLinesPerSecond
# Maximum number of new lines the agent will send per second to Zabbix Server
# or Proxy processing 'log' and 'logrt' active checks.
# The provided value will be overridden by the parameter 'maxlines',
# provided in 'log' or 'logrt' item keys.
#
# Mandatory: no
# Range: 1-1000
# Default:
# Plugins.Log.MaxLinesPerSecond=20
Plugins.Log.MaxLinesPerSecond=${ZBX_MAXLINESPERSECOND}
### Option: Plugins.WindowsEventlog.MaxLinesPerSecond
# Maximum number of new lines the agent will send per second to Zabbix Server
# or Proxy processing 'eventlog' checks.
# The provided value will be overridden by the parameter 'maxlines',
# provided in 'eventlog' item keys.
#
# Mandatory: no
# Range: 1-1000
# Default:
# Plugins.WindowsEventlog.MaxLinesPerSecond=20
Plugins.WindowsEventlog.MaxLinesPerSecond=${ZBX_EVENTLOGMAXLINESPERSECOND}
### Option: HeartbeatFrequency
# Frequency of heartbeat messages in seconds.
# Used for monitoring availability of active checks.
# 0 - heartbeat messages disabled.
#
# Mandatory: no
# Range: 0-3600
# Default: 60
# HeartbeatFrequency=
HeartbeatFrequency=${ZBX_HEARTBEAT_FREQUENCY}
### Option: ForceActiveChecksOnStart
# Perform active checks immediately after restart for first received configuration.
# Also available as per plugin configuration, example: Plugins.Uptime.System.ForceActiveChecksOnStart=1
#
# Mandatory: no
# Range: 0-1
# Default:
# ForceActiveChecksOnStart=0
ForceActiveChecksOnStart=${ZBX_FORCEACTIVECHECKSONSTART}

View File

@ -0,0 +1,12 @@
### Option: Alias
# Sets an alias for an item key. It can be used to substitute long and complex item key with a smaller and simpler one.
# Multiple Alias parameters may be present. Multiple parameters with the same Alias key are not allowed.
# Different Alias keys may reference the same item key.
# For example, to retrieve the ID of user 'zabbix':
# Alias=zabbix.userid:vfs.file.regexp[/etc/passwd,^zabbix:.:([0-9]+),,,,\1]
# Now shorthand key zabbix.userid may be used to retrieve data.
# Aliases can be used in HostMetadataItem but not in HostnameItem parameters.
#
# Mandatory: no
# Range:
# Default:

View File

@ -0,0 +1,20 @@
### Option: AllowKey
# Allow execution of item keys matching pattern.
# Multiple keys matching rules may be defined in combination with DenyKey.
# Key pattern is wildcard expression, which support "*" character to match any number of any characters in certain position. It might be used in both key name and key arguments.
# Parameters are processed one by one according their appearance order.
# If no AllowKey or DenyKey rules defined, all keys are allowed.
#
# Mandatory: no
### Option: DenyKey
# Deny execution of items keys matching pattern.
# Multiple keys matching rules may be defined in combination with AllowKey.
# Key pattern is wildcard expression, which support "*" character to match any number of any characters in certain position. It might be used in both key name and key arguments.
# Parameters are processed one by one according their appearance order.
# If no AllowKey or DenyKey rules defined, all keys are allowed.
# Unless another system.run[*] rule is specified DenyKey=system.run[*] is added by default.
#
# Mandatory: no
# Default:
# DenyKey=system.run[*]

View File

@ -0,0 +1,17 @@
### Option:PluginSocket
# Path to unix socket for external plugin communications.
#
# Mandatory: no
# Default:\\.\pipe\agent.plugin.sock
# PluginSocket=
PluginSocket=\\.\pipe\agent.plugin.sock
### Option: ControlSocket
# The control socket, used to send runtime commands with '-R' option.
#
# Mandatory: no
# Default:
# ControlSocket=
ControlSocket=\\.\pipe\agent.sock

View File

@ -0,0 +1,38 @@
### Option: LogType
# Specifies where log messages are written to:
# system - syslog
# file - file specified with LogFile parameter
# console - standard output
#
# Mandatory: no
# Default:
# LogType=file
LogType=console
### Option: DebugLevel
# Specifies debug level:
# 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)
#
# Mandatory: no
# Range: 0-5
# Default:
# DebugLevel=3
DebugLevel=${ZBX_DEBUGLEVEL}
### Option: Plugins.SystemRun.LogRemoteCommands
# Enable logging of executed shell commands as warnings.
# 0 - disabled
# 1 - enabled
#
# Mandatory: no
# Default:
# Plugins.SystemRun.LogRemoteCommands=0
Plugins.SystemRun.LogRemoteCommands=${ZBX_LOGREMOTECOMMANDS}

View File

@ -0,0 +1,38 @@
### Option: ListenIP
# List of comma delimited IP addresses that the agent should listen on.
# First IP address is sent to Zabbix server if connecting to it to retrieve list of active checks.
#
# Mandatory: no
# Default:
# ListenIP=0.0.0.0
ListenIP=${ZBX_LISTENIP}
### Option: ListenPort
# Agent will listen on this port for connections from the server.
#
# Mandatory: no
# Range: 1024-32767
# Default:
# ListenPort=10050
ListenPort=${ZBX_LISTENPORT}
### Option: SourceIP
# Source IP address for outgoing connections.
#
# Mandatory: no
# Default:
# SourceIP=
SourceIP=${ZBX_SOURCEIP}
### Option: StatusPort
# Agent will listen on this port for HTTP status requests.
#
# Mandatory: no
# Range: 1024-32767
# Default:
# StatusPort=
StatusPort=${ZBX_STATUSPORT}

View File

@ -0,0 +1,15 @@
##### Passive checks related
### Option: Server
# List of comma delimited IP addresses, optionally in CIDR notation, or DNS names of Zabbix servers and Zabbix proxies.
# Incoming connections will be accepted only from the hosts listed here.
# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally
# and '::/0' will allow any IPv4 or IPv6 address.
# '0.0.0.0/0' can be used to allow any IPv4 address.
# Example: Server=127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.example.com
#
# Mandatory: yes, if StartAgents is not explicitly set to 0
# Default:
# Server=
Server=${ZBX_PASSIVESERVERS}

View File

@ -0,0 +1,19 @@
### Option: Timeout
# Specifies how long to wait (in seconds) for establishing connection and exchanging data with Zabbix proxy or server.
#
# Mandatory: no
# Range: 1-30
# Default:
# Timeout=3
Timeout=${ZBX_TIMEOUT}
### Option:PluginTimeout
# Timeout for connections with external plugins.
#
# Mandatory: no
# Range: 1-30
# Default: <Global timeout>
# PluginTimeout=
PluginTimeout=${ZBX_PLUGINTIMEOUT}

View File

@ -0,0 +1,136 @@
####### TLS-RELATED PARAMETERS #######
### Option: TLSConnect
# How the agent should connect to server or proxy. Used for active checks.
# Only one value can be specified:
# unencrypted - connect without encryption
# psk - connect using TLS and a pre-shared key
# cert - connect using TLS and a certificate
#
# Mandatory: yes, if TLS certificate or PSK parameters are defined (even for 'unencrypted' connection)
# Default:
# TLSConnect=unencrypted
TLSConnect=${ZBX_TLSCONNECT}
### Option: TLSAccept
# What incoming connections to accept.
# Multiple values can be specified, separated by comma:
# unencrypted - accept connections without encryption
# psk - accept connections secured with TLS and a pre-shared key
# cert - accept connections secured with TLS and a certificate
#
# Mandatory: yes, if TLS certificate or PSK parameters are defined (even for 'unencrypted' connection)
# Default:
# TLSAccept=unencrypted
TLSAccept=${ZBX_TLSACCEPT}
### Option: TLSCAFile
# Full pathname of a file containing the top-level CA(s) certificates for
# peer certificate verification.
#
# Mandatory: no
# Default:
# TLSCAFile=
TLSCAFile=${ZBX_TLSCAFILE}
### Option: TLSCRLFile
# Full pathname of a file containing revoked certificates.
#
# Mandatory: no
# Default:
# TLSCRLFile=
TLSCRLFile=${ZBX_TLSCRLFILE}
### Option: TLSServerCertIssuer
# Allowed server certificate issuer.
#
# Mandatory: no
# Default:
# TLSServerCertIssuer=
TLSServerCertIssuer=${ZBX_TLSSERVERCERTISSUER}
### Option: TLSServerCertSubject
# Allowed server certificate subject.
#
# Mandatory: no
# Default:
# TLSServerCertSubject=
TLSServerCertSubject=${ZBX_TLSSERVERCERTSUBJECT}
### Option: TLSCertFile
# Full pathname of a file containing the agent certificate or certificate chain.
#
# Mandatory: no
# Default:
# TLSCertFile=
TLSCertFile=${ZBX_TLSCERTFILE}
### Option: TLSKeyFile
# Full pathname of a file containing the agent private key.
#
# Mandatory: no
# Default:
# TLSKeyFile=
TLSKeyFile=${ZBX_TLSKEYFILE}
### Option: TLSPSKIdentity
# Unique, case sensitive string used to identify the pre-shared key.
#
# Mandatory: no
# Default:
# TLSPSKIdentity=
TLSPSKIdentity=${ZBX_TLSPSKIDENTITY}
### Option: TLSPSKFile
# Full pathname of a file containing the pre-shared key.
#
# Mandatory: no
# Default:
# TLSPSKFile=
TLSPSKFile=${ZBX_TLSPSKFILE}
####### For advanced users - TLS ciphersuite selection criteria #######
### Option: TLSCipherCert13
# Cipher string for OpenSSL 1.1.1 or newer in TLS 1.3.
# Override the default ciphersuite selection criteria for certificate-based encryption.
#
# Mandatory: no
# Default:
# TLSCipherCert13=
TLSCipherCert13=${ZBX_TLSCIPHERCERT13}
### Option: TLSCipherPSK13
# Cipher string for OpenSSL 1.1.1 or newer in TLS 1.3.
# Override the default ciphersuite selection criteria for PSK-based encryption.
# Example:
# TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256
#
# Mandatory: no
# Default:
# TLSCipherPSK13=
TLSCipherPSK13=${ZBX_TLSCIPHERPSK13}
### Option: TLSCipherAll13
# Cipher string for OpenSSL 1.1.1 or newer in TLS 1.3.
# Override the default ciphersuite selection criteria for certificate- and PSK-based encryption.
# Example:
# TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256
#
# Mandatory: no
# Default:
# TLSCipherAll13=
TLSCipherAll13=${ZBX_TLSCIPHERALL13}

View File

@ -0,0 +1,37 @@
####### USER-DEFINED MONITORED PARAMETERS #######
### Option: UnsafeUserParameters
# Allow all characters to be passed in arguments to user-defined parameters.
# The following characters are not allowed:
# \ ' " ` * ? [ ] { } ~ $ ! & ; ( ) < > | # @
# Additionally, newline characters are not allowed.
# 0 - do not allow
# 1 - allow
#
# Mandatory: no
# Range: 0-1
# Default:
# UnsafeUserParameters=0
UnsafeUserParameters=${ZBX_UNSAFEUSERPARAMETERS}
### Option: UserParameter
# User-defined parameter to monitor. There can be several user-defined parameters.
# Format: UserParameter=<key>,<shell command>
# See 'zabbix_agentd' directory for examples.
#
# Mandatory: no
# Default:
# UserParameter=
### Option: UserParameterDir
# Directory to execute UserParameter commands from. Only one entry is allowed.
# When executing UserParameter commands the agent will change the working directory to the one
# specified in the UserParameterDir option.
# This way UserParameter commands can be specified using the relative ./ prefix.
#
# Mandatory: no
# Default:
# UserParameterDir=
UserParameterDir=${ZBX_USERPARAMETERDIR}

View File

@ -14,15 +14,17 @@ Zabbix build base (PostgreSQL) image is used for building Zabbix components. It
# Zabbix build base (PostgreSQL) images
These are the only official Zabbix build base (PostgreSQL) Docker images. They are based on Alpine Linux v3.20, Ubuntu 24.04 (noble), CentOS Stream 9 and Oracle Linux 9 images. The available versions of the image are:
These are the only official Zabbix build base (PostgreSQL) Docker images. They are based on Alpine Linux v3.23, Ubuntu 24.04 (noble), CentOS Stream 10 and Oracle Linux 10 images. The available versions of the image are:
Zabbix build base 5.0 (tags: alpine-5.0-latest, ubuntu-5.0-latest, ol-5.0-latest)
Zabbix build base 5.0.* (tags: alpine-5.0.*, ubuntu-5.0.*, ol-5.0.*)
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 6.4 (tags: alpine-6.4-latest, ubuntu-6.4-latest, ol-6.4-latest, alpine-latest, ubuntu-latest, ol-latest, latest)
Zabbix build base 6.4.* (tags: alpine-6.4.*, ubuntu-6.4.*, ol-6.4.*)
Zabbix build base 7.0 (tags: alpine-trunk, ubuntu-trunk, ol-trunk)
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.
@ -30,7 +32,7 @@ Images are updated when new releases are published. The image with ``latest`` ta
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/trunk/Dockerfiles/build-base) image with prepared build environment as base image and build / compile Zabbix components only.
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
@ -64,7 +66,7 @@ Please see [the Docker installation documentation](https://docs.docker.com/insta
## Documentation
Documentation for this image is stored in the [`build-base/` directory](https://github.com/zabbix/zabbix-docker/tree/trunk/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/master/README.md) before attempting a pull request.
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/master/README.md) before attempting a pull request.
## Issues

View File

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG MAJOR_VERSION=7.0
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}.6
ARG BUILD_BASE_IMAGE=zabbix-build-base:alpine-${ZBX_VERSION}
FROM ${BUILD_BASE_IMAGE} AS builder
@ -8,7 +8,10 @@ FROM ${BUILD_BASE_IMAGE} AS builder
ARG MAJOR_VERSION
ARG ZBX_VERSION
ARG ZBX_SOURCES=https://git.zabbix.com/scm/zbx/zabbix.git
ARG GIT_BRANCH=master
ARG GIT_BRANCH
ARG ZBX_PLUGINS_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
ARG CFLAGS
LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
org.opencontainers.image.description="Zabbix build base for PostgreSQL based images" \
@ -22,14 +25,18 @@ LABEL org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zab
ENV ZBX_SOURCES_DIR=/tmp/zabbix-${ZBX_VERSION} ZBX_OUTPUT_DIR=/tmp/zabbix-${ZBX_VERSION}-output \
DB_TYPE=postgresql \
MONGODB_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mongodb.git MONGODB_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
POSTGRESQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/postgresql.git POSTGRESQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
MSSQL_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/mssql.git MSSQL_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION} \
EMBER_PLUS_PLUGIN_SOURCES=https://git.zabbix.com/scm/ap/ember-plus.git EMBER_PLUS_PLUGIN_VERSION=${GIT_BRANCH:-$ZBX_VERSION}
CFLAGS=${CFLAGS:-"-fPIC -pie -Wl,-z,relro,-z,now,-z,defs -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe"} \
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=type=cache,target=/root/.cache/go-build/ \
--mount=type=cache,target=/root/go/ \
--mount=type=bind,source=conf/chromedp_no_sandbox.patch,target=/tmp/chromedp_no_sandbox.patch \
--mount=from=sources,target=/tmp/src \
--mount=type=bind,source=patches/,target=/tmp/patches \
--mount=from=config_templates,target=/tmp/conf \
set -eux && \
cd /tmp/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
@ -51,39 +58,46 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
mkdir -p ${ZBX_OUTPUT_DIR}/general/sbin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/bin/ && \
mkdir -p ${ZBX_OUTPUT_DIR}/general/conf/ && \
git -c advice.detachedHead=false clone ${ZBX_SOURCES} --branch ${GIT_BRANCH:-$ZBX_VERSION} --depth 1 --single-branch ${ZBX_SOURCES_DIR} && \
if [ -f "/tmp/src/bootstrap.sh" ]; then \
cp -R /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} && \
patch -p1 < /tmp/chromedp_no_sandbox.patch && \
for patch_filename in /tmp/patches/*.patch; do \
if [ -f "$patch_filename" ]; then \
patch -p1 < "$patch_filename"; \
fi \
done && \
zabbix_revision=`git rev-parse --short HEAD` && \
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 && \
./bootstrap.sh && \
export CFLAGS="-fPIC -pie -Wl,-z,relro,-z,now,-z,defs" && \
export CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fexceptions -O2 -pipe" && \
./configure \
--datadir=/usr/lib \
--libdir=/usr/lib/zabbix \
--prefix=/usr \
--sysconfdir=/etc/zabbix \
--enable-ipv6 \
--enable-agent \
--enable-agent2 \
--enable-ipv6 \
--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-${DB_TYPE} \
--with-ssh \
--with-unixodbc \
--enable-java \
--silent && \
make -j"$(nproc)" -s dbschema && \
make -j"$(nproc)" -s && \
@ -98,7 +112,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
cp -R ${ZBX_SOURCES_DIR}/database/postgresql/timescaledb/option-patches/with-compression/*.sql ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/option-patches/with-compression/ && \
cp -R ${ZBX_SOURCES_DIR}/database/postgresql/timescaledb/option-patches/without-compression/*.sql ${ZBX_OUTPUT_DIR}/server/database/${DB_TYPE}/option-patches/without-compression/ && \
mkdir /tmp/fonts/ && \
curl --tlsv1.2 -sSf -L "https://noto-website.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
curl --tlsv1.2 -sSf -L "https://noto-website-2.storage.googleapis.com/pkgs/NotoSansCJKjp-hinted.zip" -o /tmp/fonts/NotoSansCJKjp-hinted.zip && \
unzip /tmp/fonts/NotoSansCJKjp-hinted.zip -d /tmp/fonts/ && \
cp /tmp/fonts/NotoSansCJKjp-Regular.otf ${ZBX_SOURCES_DIR}/ui/assets/fonts/NotoSansCJKjp-Regular.ttf && \
cp /tmp/fonts/LICENSE_OFL.txt ${ZBX_SOURCES_DIR}/ui/assets/fonts/ && \
@ -114,19 +128,24 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
strip ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender && \
strip ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_agent/zabbix_agentd ${ZBX_OUTPUT_DIR}/agent/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_agentd.conf ${ZBX_OUTPUT_DIR}/agent/conf/zabbix_agentd.conf_template && \
cp /tmp/conf/agent/* ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/conf/zabbix_agentd/ ${ZBX_OUTPUT_DIR}/agent/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_agent2 ${ZBX_OUTPUT_DIR}/agent2/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.conf_template && \
cp /tmp/conf/agent2/* ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_agent2.d/ ${ZBX_OUTPUT_DIR}/agent2/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_server/zabbix_server ${ZBX_OUTPUT_DIR}/server/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_server.conf ${ZBX_OUTPUT_DIR}/server/conf/zabbix_server.conf_template && \
cp /tmp/conf/server/* ${ZBX_OUTPUT_DIR}/server/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_proxy/zabbix_proxy ${ZBX_OUTPUT_DIR}/proxy/sbin/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp ${ZBX_SOURCES_DIR}/conf/zabbix_proxy.conf ${ZBX_OUTPUT_DIR}/proxy/conf/zabbix_proxy.conf_template && \
cp /tmp/conf/proxy/* ${ZBX_OUTPUT_DIR}/proxy/conf/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/bin/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp -R ${ZBX_SOURCES_DIR}/src/zabbix_java/lib/ ${ZBX_OUTPUT_DIR}/java_gateway/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/bin/zabbix_web_service ${ZBX_OUTPUT_DIR}/web_service/sbin/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/go/conf/zabbix_web_service.conf ${ZBX_OUTPUT_DIR}/web_service/conf/zabbix_web_service.conf_template && \
cp /tmp/conf/web_service/* ${ZBX_OUTPUT_DIR}/web_service/conf/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_get/zabbix_get ${ZBX_OUTPUT_DIR}/general/bin/ && \
cp ${ZBX_SOURCES_DIR}/src/zabbix_sender/zabbix_sender ${ZBX_OUTPUT_DIR}/general/bin/ && \
make -s distclean && \
@ -159,4 +178,11 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \
make && \
strip /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/zabbix-agent2-plugin-ember-plus ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/ember-plus && \
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/
cp /tmp/ember-plugin-${EMBER_PLUS_PLUGIN_VERSION}/ember.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \
cd /tmp/ && \
git -c advice.detachedHead=false clone ${NVIDIA_GPU_PLUGIN_SOURCES} --branch ${NVIDIA_GPU_PLUGIN_VERSION} --depth 1 --single-branch /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
cd /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION} && \
make && \
strip /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/zabbix-agent2-plugin-nvidia-gpu ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/nvidia-gpu && \
cp /tmp/nvidia-gpu-plugin-${NVIDIA_GPU_PLUGIN_VERSION}/nvidia.conf ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/

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