No description
  • C 64.1%
  • Python 25.3%
  • Makefile 4.3%
  • M4 1.9%
  • Shell 1.4%
  • Other 3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Giuseppe Scrivano fb54bc00bf
Merge pull request #2137 from eriksjolund/fix-double-close
status: fix double-close
2026-07-15 09:47:30 +02:00
.fmf packit: podman reverse dependency tests 2024-03-19 17:32:13 +05:30
.github build(deps): bump actions/cache from 5 to 6 2026-06-29 17:32:24 +00:00
build-aux Build: Use system libblake if available 2026-05-14 14:45:59 +05:30
contrib Replace YAJL with json-c for JSON parsing and generation 2026-05-13 10:55:47 +02:00
design-docs Document error handling 2026-03-16 20:06:59 +01:00
docs test: use wasm32-wasip1 instead of wasm32-wasi 2025-01-10 14:15:22 +01:00
libocispec@b465698c1d crun hooks: style json config as it was with yajl 2026-07-02 00:38:40 +09:00
lua Replace YAJL with json-c for JSON parsing and generation 2026-05-13 10:55:47 +02:00
m4 lua: add Lua bindings 2023-03-16 23:07:14 +08:00
nix Build: Use system libblake if available 2026-05-14 14:45:59 +05:30
plans plans: install iptables-legacy on CS9 2026-03-03 18:40:28 -08:00
python Replace YAJL with json-c for JSON parsing and generation 2026-05-13 10:55:47 +02:00
rpm Build: Use system libblake if available 2026-05-14 14:45:59 +05:30
src Merge pull request #2137 from eriksjolund/fix-double-close 2026-07-15 09:47:30 +02:00
tests tests: add rootless podman system tests 2026-07-09 18:47:52 +02:00
.clang-format .clang-format: fixup for v22.1.4 2026-05-01 12:44:35 -07:00
.codespellrc .codespellrc: ignore passt 2026-04-17 10:08:18 +02:00
.copr rhcontainerbot/podman-next COPR autobuild 2022-03-14 10:16:27 -04:00
.editorconfig Add .editorconfig 2025-10-02 16:05:54 -07:00
.gitignore lua: added luarocks packing 2023-06-01 13:56:29 +08:00
.gitmodules gitmodules: use containers/libocispec.git repository 2019-08-12 10:48:21 +02:00
.lgtm.yml .lgtm.yml: new file 2020-06-06 12:54:52 +02:00
.packit.yaml Packit/TMT: re-enable centos-stream-10-x86_64 tests 2026-03-03 17:31:03 -08:00
AGENTS.md Document error handling 2026-03-16 20:06:59 +01:00
autogen.sh Let autogen.sh generate m4 2021-03-21 01:05:57 +05:30
cfg.mk cfg.mk: prohibit usage of sprintf 2025-06-11 11:33:12 +02:00
CODE-OF-CONDUCT.md Add Code of Conduct 2020-02-08 16:26:08 -05:00
configure.ac Build: Use system libblake if available 2026-05-14 14:45:59 +05:30
CONTRIBUTING.md CONTRIBUTING.md: new file 2024-10-25 16:40:02 +02:00
COPYING license: change license to gplv2+ and lgpl2.1+ 2020-02-26 08:04:51 +01:00
COPYING.libcrun license: change license to gplv2+ and lgpl2.1+ 2020-02-26 08:04:51 +01:00
crun.1 Merge pull request #2111 from leonardomoreira00/bug/fix-man-page-delete-and-kill-regex 2026-06-22 15:12:41 +02:00
crun.1.md Merge pull request #2111 from leonardomoreira00/bug/fix-man-page-delete-and-kill-regex 2026-06-22 15:12:41 +02:00
flake.lock nix: migrate to flakes 2026-03-23 21:33:06 +01:00
flake.nix Replace YAJL with json-c for JSON parsing and generation 2026-05-13 10:55:47 +02:00
GNUmakefile Update GNUmakefile 2021-03-16 10:21:38 +01:00
krun.1 krun.1: regenerate 2025-04-24 19:07:12 -07:00
krun.1.md krun: document microVM configuration options in man page 2026-05-14 12:50:52 -04:00
libcrun.lds build: export json_gen_* symbols 2026-05-28 10:55:04 +02:00
maint.mk build: add tests coverage 2025-12-12 14:31:18 +01:00
Makefile.am Build: Use system libblake if available 2026-05-14 14:45:59 +05:30
NEWS NEWS: tag 1.28 2026-05-27 11:58:25 +02:00
README.md Replace YAJL with json-c for JSON parsing and generation 2026-05-13 10:55:47 +02:00
SECURITY.md SECURITY.md: document security scope and trust boundaries 2026-07-13 16:26:55 +02:00

Coverity Status CodeQL

A fast and low-memory footprint OCI Container Runtime fully written in C.

crun conforms to the OCI Container Runtime specifications (https://github.com/opencontainers/runtime-spec).

Documentation

The user documentation is available here.

Why another implementation?

While most of the tools used in the Linux containers ecosystem are written in Go, I believe C is a better fit for a lower level tool like a container runtime. runc, the most used implementation of the OCI runtime specs written in Go, re-execs itself and use a module written in C for setting up the environment before the container process starts.

crun aims to be also usable as a library that can be easily included in programs without requiring an external process for managing OCI containers.

Performance

crun is faster than runc and has a much lower memory footprint.

This is the elapsed time on my machine for running sequentially 100 containers, the containers run /bin/true:

crun runc %
100 /bin/true 0:01.69 0:3.34 -49.4%

crun requires fewer resources, so it is also possible to set stricter limits on the memory allowed in the container:

# podman --runtime /usr/bin/runc run --rm --memory 4M fedora echo it works
Error: container_linux.go:346: starting container process caused "process_linux.go:327: getting pipe fds for pid 13859 caused \"readlink /proc/13859/fd/0: no such file or directory\"": OCI runtime command not found error

# podman --runtime /usr/bin/crun run --rm --memory 512k fedora echo it works
it works

Dependencies

These dependencies are required for the build:

Fedora

$ sudo dnf install -y \
    autoconf automake gcc git-core glibc-static go-md2man \
    libcap-devel libseccomp-devel libtool make pkg-config \
    python python-libmount systemd-devel json-c-devel

RHEL/CentOS Stream 9

$ sudo dnf config-manager --set-enabled crb
$ sudo dnf install -y \
    autoconf automake gcc git-core glibc-static go-md2man \
    libcap-devel libseccomp-devel libtool make pkg-config \
    python python-libmount systemd-devel json-c-devel

RHEL/CentOS Stream 10

$ sudo dnf config-manager --set-enabled crb
$ sudo dnf install -y \
    autoconf automake gcc git-core glibc-static go-md2man \
    libcap-devel libseccomp-devel libtool make pkg-config \
    python python-libmount systemd-devel

Ubuntu

$ sudo apt-get install -y make git gcc build-essential pkgconf libtool \
   libsystemd-dev libprotobuf-c-dev libcap-dev libseccomp-dev libjson-c-dev \
   go-md2man autoconf python3 automake

Alpine

# apk add gcc automake autoconf libtool gettext pkgconf git make musl-dev \
    python3 libcap-dev libseccomp-dev json-c-dev argp-standalone go-md2man

Tumbleweed

# zypper install make automake autoconf gettext libtool gcc libcap-devel \
systemd-devel libjson-c-devel libseccomp-devel python3 go-md2man \
glibc-static;

Note that Tumbleweed requires you to specify libseccomp's header file location as a compiler flag.

# ./autogen.sh
# ./configure CFLAGS='-I/usr/include/libseccomp'
# make

Build

Unless you are also building the Python bindings, Python is needed only by libocispec to generate the C parser at build time, it won't be used afterwards.

Once all the dependencies are installed:

$ ./autogen.sh
$ ./configure
$ make

To install into default PREFIX (/usr/local):

$ sudo make install

Shared Libraries

The previous build instructions do not enable shared libraries, therefore you will be unable to use libcrun. If you wish to build the shared libraries you can change the previous ./configure statement to ./configure --enable-shared.

Static build

It is possible to build a statically linked binary of crun by using the officially provided nix package and the derivation of it within this repository. The builds are completely reproducible and will create a x86_64/amd64 stripped ELF binary for glibc.

Nix

To build the binaries by locally installing the nix package manager:

$ curl -L https://nixos.org/nix/install | sh
$ git clone --recursive https://github.com/containers/crun.git && cd crun
$ nix build -f nix/
$ ./result/bin/crun --version

Ansible

An Ansible Role is also available to automate the installation of the above statically linked binary on its supported OS:

$ sudo su -
# mkdir -p ~/.ansible/roles
# cd ~/.ansible/roles
# git clone https://github.com/alvistack/ansible-role-crun.git crun
# cd ~/.ansible/roles/crun
# pip3 install --upgrade --ignore-installed --requirement requirements.txt
# molecule converge
# molecule verify

Lua bindings

A Lua binding is available. See the README for more information.