A fast and lightweight fully featured OCI runtime and C library for running containers
open sourceGPL-2.0-or-later AND LGPL-2.1-or-laterself-hostablefree
crun is a low-level OCI container runtime written in C: given an OCI runtime config.json and a root filesystem, it sets up namespaces, cgroups, capabilities, seccomp, devices, mounts and LSM labels and starts the container process, as runc does. Its README shows it running 100 containers in about half runc's time and in a much smaller memory limit, and it's also a library (libcrun) that programs can embed without an external process, with Lua and Python bindings. Experimental handlers run WebAssembly workloads directly and start containers inside a KVM microVM through libkrun (the krun mode). Red Hat stewards it; the crun program is GPL-2.0-or-later and libcrun LGPL-2.1-or-later.
Ways to install
Package managers
Problems it solves
- a faster, lower-memory OCI runtime than runc for Podman or CRI-O
- run containers under very tight memory limits where runc fails to start them
- start many short-lived containers quickly on the same host
- embed an OCI container runtime as a C library in my program, without spawning a separate process
- run a WebAssembly module as a container with Podman on Kubernetes
- start a container inside a lightweight KVM VM using the same OCI tooling
- checkpoint a running container with CRIU and restore it later
- run rootless containers as an unprivileged user with cgroup v2 and systemd
- a statically linked container runtime binary built reproducibly with Nix
- verify signed releases of the low-level container runtime we ship
Features
- implements the OCI Container Runtime specification
- faster than runc in its README's benchmark, with a much lower memory footprint
- libcrun library for embedding, with Lua and Python bindings
- create, start, run, exec, pause, resume, kill, delete, list, ps, update, spec, checkpoint and restore commands
- rootless containers; spec --rootless writes a config for them
- systemd cgroup manager and cgroup v2 support
- checkpoint and restore through CRIU, including pre-dumps and lazy pages
- seccomp, AppArmor and SELinux labels, with OCI annotations such as a seccomp notify receiver
- experimental wasm handler that runs .wasm or .wat modules as containers
- experimental krun handler that runs containers in a KVM microVM through libkrun
View 2 more
- release artifacts signed with keys in crun.keyring
- reproducible static builds through Nix
Limitations
- Doesn't pull or build images: crun isn't a container engine, so Podman, CRI-O or containerd call it3
- Doesn't run Windows containers: crun runs Linux containers that follow the OCI format4
Capabilities
| Has a command line tool | plan not known |
|---|---|
| Has official SDKs | plan not known |
Alternatives
The same job
These do what crun does.
- youki A container runtime written in Rust
- runc CLI tool for spawning and running containers according to the OCI specification
- CRI-O Lightweight Container Runtime for Kubernetes
- Kata Containers The speed of containers, the security of VMs
- gVisor Application Kernel for Containers
