First, build and install the runc snap:
- git clone https://github.com/elopio/runc
- cd runc
- git checkout snapcraft
- sudo apt install snapcraft
- snapcraft
- sudo snap install runc*.snap
Print the help:
$ runc
$ runc help
$ runc h
$ runc -h
$ runc --help
NAME:
runc - Open Container Initiative runtime
[...]
Print the version:
$ runc --version
$ runc -v
runc version 0.1.1
spec: 0.6.0-dev
Install docker, required for the next step:
$ `sudo apt install docker.io`
Create an OCI bundle:
(The snap only has permission to write to its own home directory, so we create the bundle there. If this is the first time you install the runc snap, then $REVISION will be x1
.)
$ mkdir $HOME/snap/runc/$REVISION/container
$ cd $HOME/snap/runc/$REVISION/container
$ mkdir rootfs
$ sudo docker export $(sudo docker create busybox) | tar -C rootfs -xvf -
Docker has the runc deb package as a dependency. To make sure that we are running runc from the snap, uninstall the deb:
$ sudo apt remove runc
Generate a spec:
$ runc spec
$ cat config.json
{
"ociVersion": "1.0.0-rc1",
"platform": {
"os": "linux",
"arch": "amd64"
},
[...]
Run the container:
$ runc run testcontainer
I have problems to run the container:
$ runc run testcontainer
runc should be run as root
$ sudo runc run testcontainer
open config.json: permission denied