Runc: Difference between revisions

From Alpine Linux
(added DISPLAYTITLE as runc)
(Mention that this works with crun too.)
Line 1: Line 1:
{{DISPLAYTITLE:runc}}[https://github.com/opencontainers/runc runc] is a CLI tool for spawning and running containers on Linux according to the OCI specification. This page provides instructions to setup containers using runc.
{{DISPLAYTITLE:runc}}[https://github.com/opencontainers/runc runc] is a CLI tool for spawning and running containers on Linux according to the OCI specification, implemented in Go.. This page provides instructions to setup containers using runc.


== Prerequisites ==
== Prerequisites ==
Line 8: Line 8:


Here are the steps to create a minimal container using runc and Alpine Linux.
Here are the steps to create a minimal container using runc and Alpine Linux.
This creates an OCI bundle


{{Cmd|# apk add runc}}
{{Cmd|# apk add runc}}
Line 14: Line 15:
{{Cmd|# cd /opt/busybox-container && runc spec}}
{{Cmd|# cd /opt/busybox-container && runc spec}}
{{Cmd|# runc run busybox-1}}
{{Cmd|# runc run busybox-1}}
== Alternatives ==
An alternative to [https://github.com/containers/crun runc] is crun which is a fast and lightweight fully featured OCI runtime and C library for running containers.
The commands in the example above can be switched to use crun instead and it can be installed with {{Cmd|# apk add crun}}.


== See also ==
== See also ==

Revision as of 07:27, 5 July 2025

runc is a CLI tool for spawning and running containers on Linux according to the OCI specification, implemented in Go.. This page provides instructions to setup containers using runc.

Prerequisites

Set up a minimal container

Here are the steps to create a minimal container using runc and Alpine Linux. This creates an OCI bundle

# apk add runc

# mkdir /opt/busybox-container

# apk --arch x86_64 -X https://dl-cdn.alpinelinux.org/alpine/edge/main/ --root /opt/busybox-container/rootfs --initdb --no-cache --allow-untrusted add busybox

# cd /opt/busybox-container && runc spec

# runc run busybox-1


Alternatives

An alternative to runc is crun which is a fast and lightweight fully featured OCI runtime and C library for running containers.

The commands in the example above can be switched to use crun instead and it can be installed with

# apk add crun

.

See also