Skip to content
zviz

Build from source and run your first container

Compile ZViz with Zig 0.15+, extract an OCI rootfs, and run it under a selective-denial profile.

Level: beginnerTime: 15 min

ZViz ships as source. This guide takes you from a clean machine to a running, sandboxed container.

Prerequisites

  • A Linux host on kernel ≥ 5.13 (for Landlock) with cgroups v2 enabled.
  • Zig 0.15.0+ to build from source.

1. Install Zig

Download Zig 0.15.0 or newer from ziglang.org and put it on your PATH:

zig version   # 0.15.0 or newer

2. Clone and build

git clone https://github.com/Skelf-Research/zviz.git
cd zviz
zig build -Doptimize=ReleaseSafe

The binary is written to zig-out/bin/zviz.

3. Extract an OCI rootfs

Any OCI rootfs works. The quickest way is to export one from an existing image:

mkdir -p ~/bundle/rootfs
docker create --name x redis:alpine
docker export x | tar -C ~/bundle/rootfs -xf -
docker rm x

4. Run it

Add a minimal config.json to ~/bundle, then:

./zig-out/bin/zviz run my-container ~/bundle

ZViz sets up namespaces, drops all 41 capabilities, applies Landlock, loads the seccomp filter, applies cgroups v2 limits, and exec-replaces into PID 1.

Next steps

Frequently Asked Questions

Do I need Docker to use ZViz?

No. Docker is just a convenient way to produce a rootfs here. Any OCI rootfs works — you can build one however you like and point ZViz at it.

Which platforms does ZViz build on?

ZViz is a Linux runtime. You build it with Zig on Linux and run it on a Linux host with kernel 5.13+ and cgroups v2.

Related

Run untrusted code with a smaller attack surface

ZViz is open source under Apache 2.0. Build it and point it at any OCI bundle.