Runc vs Crun in containers world:
If you are some how into containerization technology, you might have heard about runc.
Before I go into more details I would like to tell you what container exactly is.
Containers mainly are created of two linux kernel modules; namespace and cgroup to create a jail like or isolated environment.
Namespace: is used for what you can see or access
Cgroup: is used for how much resources like RAM and CPU
What is a Container runtime?
Container runtime is a piece of software that helps you manage the isolated environment we already talked about which is called a container.
Runc and Crun are the two main container runtimes out there.
What is containerd or cri-o?
They are both the abstracted layer of container runtime on the top of runc, they are frontends to manage containers. which means, they are responsible to create, destroy, start and stop the containers.
Please have in mind that both containerd and cri-o use runc as container runtime.
So far we know what runc and crun are; let’s see the differences.
They both are container runtime and do the same thing which handling the containers.
But differences are:
1) runc is written in go while crun is written in C, so it more compatible with Linux kernel.
2) runc is made by docker and crun is made by RedHat
3) crun is lighter which results in being low memory compare to runc. Crun is 300K while runc is 15M
How about Podman?
Podman is a docker like utility which is a frontend for crun which is also responsible for managing containers.
Summery
Conclusion
Which one to use?
If you are looking for a low weight container engine whiteout additional components for both development and production environment, go with Podman.
Especially in a production environment as you will never need to build images there. So having an image building component can be considered a useless and resources consuming piece of software.
And that’s another reason to avoid having docker in production environment.
But if you are using Kubernetes go with cri-o. And if you are not happy with runc, you can easily switch its runtime to crun if you would like to have a lighter runtime in C language.
Written by kloudino.com (Mehdi Taleghani)