A multi-platform Docker image for Zabbix server and agent, built from source with security best practices.
- Complete Zabbix Stack: Builds base, server, database, and UI components
- Multi-platform support: Built for both
linux/amd64andlinux/arm64architectures - Multi-arch manifests: Automatically preserves existing architectures when building
- Security-focused: Runs as non-root user with explicit UID/GID
- Version-flexible: Automatically detects and installs correct PCRE library based on Zabbix version
- Automated builds: Single script builds entire stack with proper versioning
- Build options: Support for local builds, dry-run, force mode, and cache control
- Latest Ubuntu: Based on Ubuntu 25.04 with latest security updates
- Added explicit UID/GID (1997) for consistent user creation across architectures
- Uses
/bin/shinstead of/bin/bashfor better ARM64 compatibility - Includes debugging commands to verify user creation
- Automatically detects Zabbix version and installs correct PCRE library:
- Zabbix 7.4.x →
libpcre2-dev(PCRE2) - Zabbix 7.2.x →
libpcre3-dev(PCRE3)
- Zabbix 7.4.x →
- Configured for both AMD64 and ARM64 architectures
- Includes SBOM and provenance for security scanning
- Docker with buildx support
- Docker Hub account with repository access
The build_push_and_update_manifest.sh script simplifies building and pushing the entire Zabbix stack (base, server, db, and ui images) for different architectures and Zabbix versions.
The script builds and tags the following images:
- Base:
maborak/zabbix-base:<version>- Core Zabbix binaries - Server:
maborak/zabbix-server:<version>- Zabbix server component - DB:
maborak/zabbix-db:<version>- Database schema initialization - UI:
maborak/zabbix-ui:<version>- Web interface
--arch=<arch>(required): Architecture(s) to build for. Can be:- Single:
arm64oramd64 - Multiple:
arm64,amd64(comma-separated)
- Single:
--zabbix-version=<version>(optional): Zabbix version to build (default:7.4.1). Usegitto build from source repository--ubuntu-version=<version>(optional): Ubuntu base image version (default:25.04)--set-latest(optional): Also tag and push as:latest(default:false)--verbose(optional): Show full build output with--progress=plain(default:false)--versions(optional): List available Zabbix versions from GitHub and exit--no-cache(optional): Force rebuild without using cache (default:false)--dry-run(optional): Show what would be built/pushed without executing (default:false)--force(optional): Skip manifest checking, build only requested architectures (default:false)--push=<true|false>(optional): Push images to registry (default:true, use--push=falseto build only)
# Build for a specific architecture with default Zabbix version (7.4.1)
./build_push_and_update_manifest.sh --arch=arm64
# Build for a specific architecture with custom Zabbix version
./build_push_and_update_manifest.sh --arch=amd64 --zabbix-version=7.4.2
# Build for multiple architectures at once
./build_push_and_update_manifest.sh --arch=arm64,amd64 --zabbix-version=7.4.2
# Build and also tag as :latest
./build_push_and_update_manifest.sh --arch=arm64 --zabbix-version=7.5.0 --set-latest
# Build from git source (latest development version)
./build_push_and_update_manifest.sh --arch=amd64 --zabbix-version=git
# Build with custom Ubuntu version
./build_push_and_update_manifest.sh --arch=amd64 --zabbix-version=7.4.2 --ubuntu-version=24.04
# Build entire stack locally without pushing
./build_push_and_update_manifest.sh --arch=amd64 --push=false
# List available Zabbix versions
./build_push_and_update_manifest.sh --versions
# Preview what would be built (dry-run)
./build_push_and_update_manifest.sh --arch=amd64,arm64 --zabbix-version=7.4.2 --dry-run# Build with verbose output
./build_push_and_update_manifest.sh --arch=amd64 --zabbix-version=7.4.2 --verbose
# Force rebuild without cache
./build_push_and_update_manifest.sh --arch=amd64 --zabbix-version=7.4.2 --no-cache
# Build only requested architectures (skip manifest merging)
./build_push_and_update_manifest.sh --arch=amd64 --zabbix-version=7.4.2 --force
# Build locally with force (no manifest check, no push)
./build_push_and_update_manifest.sh --arch=arm64,amd64 --push=false --force
# Build and set as latest with verbose output
./build_push_and_update_manifest.sh --arch=amd64 --zabbix-version=7.4.2 --set-latest --verboseThe script automatically preserves existing architectures in manifests:
Example Scenario:
- You previously built
maborak/zabbix-base:7.4.2with botharm64andamd64 - You run:
./build_push_and_update_manifest.sh --arch=amd64 --zabbix-version=7.4.2 - The script detects
arm64exists and automatically builds botharm64andamd64 - The multi-arch manifest is preserved
To override this behavior:
- Use
--forceflag to skip manifest checking and build only requested architectures
You can build multi-architecture manifests in two ways:
Method 1: Single command (recommended)
# Build both architectures in one command
./build_push_and_update_manifest.sh --arch=arm64,amd64 --zabbix-version=7.4.2Method 2: Sequential builds
# Build ARM64 first
./build_push_and_update_manifest.sh --arch=arm64 --zabbix-version=7.4.2
# Build AMD64 (will automatically merge with existing ARM64)
./build_push_and_update_manifest.sh --arch=amd64 --zabbix-version=7.4.2If you prefer to build manually without the script:
docker buildx create --name mybuilder --usedocker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg ZABBIX_VERSION=7.4.2 \
-t maborak/zabbix-base:7.4.2 \
-f base/Dockerfile \
base/ \
--pushAfter the base image is built, build the components:
# Server
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg ZABBIX_BASE=maborak/zabbix-base:7.4.2 \
-t maborak/zabbix-server:7.4.2 \
-f server/Dockerfile \
server/ \
--push
# Database
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg ZABBIX_BASE=maborak/zabbix-base:7.4.2 \
-t maborak/zabbix-db:7.4.2 \
-f db/Dockerfile \
db/ \
--push
# UI
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg ZABBIX_BASE=maborak/zabbix-base:7.4.2 \
-t maborak/zabbix-ui:7.4.2 \
-f ui/Dockerfile \
ui/ \
--pushNote: The build script automates all of this and handles manifest merging automatically.
The easiest way to build different Zabbix versions is using the build script:
# Build a specific version
./build_push_and_update_manifest.sh --arch=amd64 --zabbix-version=7.4.2
# List available versions
./build_push_and_update_manifest.sh --versionsThe script will build all components (base, server, db, ui) for the specified version.
The build script creates a complete Zabbix stack:
- Base Image (
maborak/zabbix-base:<version>): Contains compiled Zabbix binaries, UI files, and database schemas - Server Image (
maborak/zabbix-server:<version>): Zabbix server with all dependencies, uses base image - DB Image (
maborak/zabbix-db:<version>): MariaDB with Zabbix database schemas pre-loaded - UI Image (
maborak/zabbix-ui:<version>): Web interface using PHP-Nginx, uses base image
All component images reference the base image using the ZABBIX_BASE build argument, ensuring version consistency across the stack.
To build manually without the script, you can use docker buildx directly:
# Build base image
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg ZABBIX_VERSION=7.4.2 \
-t maborak/zabbix-base:7.4.2 \
-f base/Dockerfile \
base/ \
--push
# Build server image (requires base image to exist)
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg ZABBIX_BASE=maborak/zabbix-base:7.4.2 \
-t maborak/zabbix-server:7.4.2 \
-f server/Dockerfile \
server/ \
--pushThe build process automatically:
- Downloads the correct Zabbix source version (or clones from git if
--zabbix-version=git) - Installs the appropriate PCRE library (PCRE2 for 7.4.x, PCRE3 for 7.2.x)
- Builds with all necessary dependencies
- Uses the specified Ubuntu version as the base image
Note: When using --zabbix-version=git, the script uses base/Dockerfile.git to build from the latest source in the Zabbix GitHub repository. This is useful for testing development versions or building custom Zabbix builds.
- Non-root execution: Container runs as
zabbixuser (UID 1997) - Explicit UID/GID: Prevents user ID conflicts across platforms
- Minimal attack surface: Only necessary runtime dependencies installed
- SBOM generation: Enables vulnerability scanning
- Build provenance: Provides build transparency and audit trail
- AMD64: Full support with optimized builds
- ARM64: Full support with ARM-specific optimizations and compatibility fixes
If you encounter "No default non-root user found" on ARM64:
- The Dockerfile includes debugging commands (
id zabbix,groups zabbix) - Check build logs for user creation verification
- Explicit UID/GID should resolve most ARM64-specific issues
- For Zabbix 7.4.x: Uses
libpcre2-dev - For Zabbix 7.2.x: Uses
libpcre3-dev - The IF-ELSE condition automatically selects the correct library
# Pull base image
docker pull maborak/zabbix-base:7.4.2
# Pull server image
docker pull maborak/zabbix-server:7.4.2
# Pull database image
docker pull maborak/zabbix-db:7.4.2
# Pull UI image
docker pull maborak/zabbix-ui:7.4.2# Start database
docker run -d \
--name zabbix-db \
-e MYSQL_ROOT_PASSWORD=zabbix \
-e MYSQL_DATABASE=zabbix \
-e MYSQL_USER=zabbix \
-e MYSQL_PASSWORD=zabbix \
maborak/zabbix-db:7.4.2
# Start Zabbix server
docker run -d \
--name zabbix-server \
--link zabbix-db:mysql \
-p 10051:10051 \
maborak/zabbix-server:7.4.2
# Start Zabbix UI
docker run -d \
--name zabbix-ui \
--link zabbix-server:zabbix-server \
-p 80:8080 \
maborak/zabbix-ui:7.4.2For a complete stack setup, use Docker Compose with all components.
This project is licensed under the same license as Zabbix.