https://github.com/containers/crun Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories - + Security - * Team * Enterprise * Explore + Explore GitHub - Learn & contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Nonprofit - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} containers / crun * Watch 41 * Star 876 * Fork 96 A fast and lightweight fully featured OCI runtime and C library for running containers View license 876 stars 96 forks Star Watch * Code * Issues 11 * Pull requests 2 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights master 1 branch 28 tags Go to file Code Clone HTTPS GitHub CLI [https://github.com/c] Use Git or checkout with SVN using the web URL. [gh repo clone contai] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio If nothing happens, download the GitHub extension for Visual Studio and try again. Go back Latest commit @giuseppe giuseppe Merge pull request #581 from alvistack/master-linux-amd64 ... ac41e19 Jan 29, 2021 Merge pull request #581 from alvistack/master-linux-amd64 Update nix pin with `make nixpkgs` ac41e19 Git stats * 1,625 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows test: use github actions for CI Dec 21, 2020 build-aux nix build --file nix/ --arg enableSystemd false Sep 14, 2020 contrib contrib: add seccomp notify plugin Aug 22, 2020 libocispec @ df96ab4 libocispec: sync from upstream Jan 21, 2021 m4 initial commit Aug 30, 2017 nix Update nix pin with `make nixpkgs` Jan 29, 2021 python fix error handling of asprintf Jul 30, 2020 rpm configure: generate short rpm version Nov 29, 2019 src linux: fix build without CLONE_NEWCGROUP Jan 22, 2021 tests cgroup: fix regression when setting limits Jan 20, 2021 .clang-format clang-format: fix casts spacing Aug 27, 2020 .gitignore build: add crun.1 to the git repository Aug 5, 2020 .gitmodules gitmodules: use containers/libocispec.git repository Aug 12, 2019 .lgtm.yml .lgtm.yml: new file Jun 6, 2020 CODE-OF-CONDUCT.md Add Code of Conduct Feb 8, 2020 COPYING license: change license to gplv2+ and lgpl2.1+ Feb 26, 2020 COPYING.libcrun license: change license to gplv2+ and lgpl2.1+ Feb 26, 2020 Dockerfile Dockerfile: fix build Jul 30, 2020 GNUmakefile configure.ac: generate version Nov 16, 2019 Makefile.am Update nix pin with `make nixpkgs` Dec 20, 2020 NEWS NEWS: tag 0.17 Jan 21, 2021 README.md closes #517 Oct 26, 2020 SECURITY.md SECURITY.md: new file Dec 9, 2019 autogen.sh autogen.sh: copy files instead of creating symlinks Feb 20, 2020 cfg.mk contrib: add example seccomp notify plugin Aug 22, 2020 configure.ac configure.ac: check insns type Dec 21, 2020 crun.1 linux: allow arbitrary IDs with single ID userns Dec 11, 2020 crun.1.md linux: allow arbitrary IDs with single ID userns Dec 11, 2020 libcrun.lds libcrun: do not export all symbols Jun 15, 2020 maint.mk make: add infrastructure for make syntax-check Sep 13, 2017 View code README.md crun Build Status Coverity Status Total alerts Language grade: C/C++ 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 and number of PIDs allowed in the container: # podman --runtime /usr/bin/runc run --rm --pids-limit 1 fedora echo it works Error: container_linux.go:346: starting container process caused "process_linux.go:319: getting the final child's pid from pipe caused \"EOF\"": OCI runtime error # podman --runtime /usr/bin/crun run --rm --pids-limit 1 fedora echo it works it works # 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 4M fedora echo it works it works crun could go much lower than that, and require < 1M. The used 4MB is a hard limit set directly in Podman before calling the OCI runtime. Dependencies These dependencies are required for the build: Fedora $ sudo dnf install -y make python git gcc automake autoconf libcap-devel \ systemd-devel yajl-devel libseccomp-devel \ go-md2man glibc-static python3-libmount libtool RHEL/CentOS 8 $ sudo yum --enablerepo='*' install -y make automake autoconf gettext \ libtool gcc libcap-devel systemd-devel yajl-devel \ libseccomp-devel python36 libtool go-md2man is not available on RHEL/CentOS 8, so if you'd like to build the man page, you also need to manually install go-md2man. It can be installed with: $ sudo yum --enablerepo='*' install -y golang $ export GOPATH=$HOME/go $ go get github.com/cpuguy83/go-md2man $ export PATH=$PATH:$GOPATH/bin Ubuntu $ sudo apt-get install -y make git gcc build-essential pkgconf libtool \ libsystemd-dev libcap-dev libseccomp-dev libyajl-dev \ go-md2man libtool autoconf python3 automake Alpine # apk add gcc automake autoconf libtool gettext pkgconf git make musl-dev \ python3 libcap-dev libseccomp-dev yajl-dev argp-standalone go-md2man Tumbleweed # zypper install make automake autoconf gettext libtool gcc libcap-devel \ systemd-devel yajl-devel libseccomp-devel python3 libtool go-md2man; 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.sh 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: $ nix build -f nix/ 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 About A fast and lightweight fully featured OCI runtime and C library for running containers Topics linux iot runtime containers oci runc iot-cloud oci-runtime Resources Readme License View license Releases 28 0.17 Latest Jan 21, 2021 + 27 releases Contributors 41 * @giuseppe * @rhatdan * @adrianreber * @kolyshkin * @hswong3i * @rst0git * @dmolik * @mrunalp * @saschagrunert * @haircommander * @crosbymichael + 30 contributors Languages * C 74.8% * Makefile 8.9% * Python 6.7% * C++ 3.2% * Shell 1.9% * Roff 1.7% * Other 2.8% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.