A lightweight Docker image based on Alpine Linux for building and testing Zig projects. It supports both official release versions and in-development builds of the Zig compiler. The image is published to Docker Hub as shmolyneaux/ziglang and built automatically via Drone CI.
Build an image with an official Zig release:
docker build . --build-arg VERSION=0.8.0Build an image with an in-development Zig version:
docker build . --build-arg DEV_BUILD=0.9.0-dev.1139+affd8f8b5Run the Zig compiler inside the container:
docker run --rm shmolyneaux/ziglang:0.9.0-dev.1139 zig version- Alpine-based — minimal image size.
- Release builds — specify any released Zig version via the
VERSIONbuild arg (default0.7.1). - Dev builds — specify any in-development Zig version via the
DEV_BUILDbuild arg, which downloads fromziglang.org/builds. - CI/CD — automated Docker Hub publishing on push via Drone CI.
- Only supports linux-x86_64 Zig binaries.
- No pre-installed system libraries beyond what Alpine provides — projects with C dependencies may need additional packages.
- The default
VERSIONbuild arg may not reflect the latest Zig release; always specify your desired version explicitly.
Development on docker-zig started 2021-07-30, and largely stopped on 2021-09-21:
- 2021-07-30 — Initial commit with Dockerfile (Zig 0.7.1 default), Drone CI pipeline for building and pushing the
0.8.0release image, LICENSE (MIT), and README. - 2021-07-30 — Fixed Drone CI build args syntax.
- 2021-09-21 — Added support for in-development (dev) Zig builds via a new
DEV_BUILDbuild arg; updated Drone pipeline to build0.9.0-dev.1139. - 2021-09-21 — Updated README with usage instructions for both release and dev builds.