GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - containers/crun: A fast and lightweight fully featured OCI runtime and C library for running containers

BranchesTags
Open more actions menu

Latest commit

 

History

5,186 Commits
5,186 Commits

Folders and files

NameName
Last commit message
Last commit date
.fmf
.fmf
 
 
.github
.github
 
 
.oss-scanner
.oss-scanner
 
 
build-aux
build-aux
 
 
contrib
contrib
 
 
design-docs
design-docs
 
 
docs
docs
 
 
libocispec @ 65e2c08
libocispec @ 65e2c08
 
 
lua
lua
 
 
m4
m4
 
 
nix
nix
 
 
plans
plans
 
 
python
python
 
 
rpm
rpm
 
 
src
src
 
 
tests
tests
 
 
.clang-format
.clang-format
 
 
.codespellrc
.codespellrc
 
 
.copr
.copr
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.lgtm.yml
.lgtm.yml
 
 
.packit.yaml
.packit.yaml
 
 
AGENTS.md
AGENTS.md
 
 
CODE-OF-CONDUCT.md
CODE-OF-CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
COPYING
COPYING
 
 
COPYING.libcrun
COPYING.libcrun
 
 
GNUmakefile
GNUmakefile
 
 
Makefile.am
Makefile.am
 
 
NEWS
NEWS
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
THREAT_MODEL.md
THREAT_MODEL.md
 
 
autogen.sh
autogen.sh
 
 
cfg.mk
cfg.mk
 
 
configure.ac
configure.ac
 
 
crun.1
crun.1
 
 
crun.1.md
crun.1.md
 
 
crun.keyring
crun.keyring
 
 
flake.lock
flake.lock
 
 
flake.nix
flake.nix
 
 
krun.1
krun.1
 
 
krun.1.md
krun.1.md
 
 
libcrun.lds
libcrun.lds
 
 
maint.mk
maint.mk
 
 
ruff.toml
ruff.toml
 
 

Repository files navigation

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.

Releases

Official releases of crun are available on the releases page.

All release artifacts are signed by one of the keys listed in the crun.keyring file in the root of this repository. To verify a release artifact:

$ gpg --no-default-keyring --keyring ./crun.gpg --import crun.keyring
$ gpg --no-default-keyring --keyring ./crun.gpg --verify crun-1.29.1.tar.zst.asc crun-1.29.1.tar.zst

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 \
    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 \
    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 \
    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 \
   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

Tumbleweed

# zypper install make automake autoconf gettext libtool gcc libcap-devel \
systemd-devel libjson-c-devel libseccomp-devel python3 \
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 --extra-experimental-features "nix-command flakes" build "path:.#crun-static-amd64"
$ ./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.

About

A fast and lightweight fully featured OCI runtime and C library for running containers

Topics

containersiotiot-cloudlinuxocioci-runtimeruncruntimewasm-oci

Resources

Readme

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

4.2k stars

Watchers

53 watching

Forks

473 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.