runc-spec(8)

πŸ“¦
version 1.5.2 Β· 5 versions
, in alpine 3.24, arch rolling, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

✨ runc-spec ✨

okay bestie, gather round πŸ’– this is the manual page for runc-spec from the System Manager's Manual β€” it's the little command that hands you a starter spec file so you can go be a container main character.


πŸŽ€ NAME πŸŽ€

runc-spec β€” create a new specification file. that's it, that's the whole job, and it eats every time πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

runc spec [option ...]

🌸 DESCRIPTION 🌸

so the spec command creates a brand-new specification file named config.json for the bundle. one file, freshly born, ready for you to shape 🫢

but listen β€” the spec it generates is just a starter file. you will have to edit it to get the results you actually want. it is not a finished masterpiece, it's a first draft.

for example, the newly generated spec includes an args parameter that is initially set to call the sh command when the container is started. and like… calling sh may work for an ubuntu container or busybox, but it will not work for containers that do not include the sh binary. so if your container has no sh, that default is giving nothing and you gotta change it. periodt.


πŸ’… OPTIONS πŸ’…

  • --bundle, -b path β€” set path to the root of the bundle directory.
  • --rootless β€” generate a configuration for a rootless container. ⚠️ note that this option is entirely different from the global --rootless option. don't get them confused, they are not the same girl.

πŸ”₯ EXAMPLES πŸ”₯

to run a simple "hello-world" container, one needs to set the args parameter in the spec to call hello. you can do that using sed(1), jq(1), or a text editor β€” whatever your vibe is.

the following commands will:

  • create a bundle for hello-world;
  • change the command to run in a container to /hello using jq(1);
  • run the hello command in a new hello-world container named container1.
mkdir hello
cd hello
docker pull hello-world
docker export $(docker create hello-world) > hello-world.tar
mkdir rootfs
tar -C rootfs -xf hello-world.tar
runc spec
jq '.process.args |= ["/hello"]' < config.json > new.json
mv -f new.json config.json
runc run container1

in the run command above, container1 is the name for the instance of the container that you are starting. the name you provide for the container instance must be unique on your host. no duplicates allowed, it's giving exclusive ✨

an alternative for generating a customized spec config is to use oci-runtime-tool; its sub-command oci-runtime-tool generate has lots of options that can be used to do any customizations as you want. see runtime-tools https://github.com/opencontainers/runtime-tools to get more information.

when starting a container through runc, the latter usually needs root privileges. if not already running as root, you can use sudo(8), for example:

sudo runc start container1

alternatively, you can start a rootless container, which has the ability to run without root privileges πŸ‘‘ for this to work, the specification file needs to be adjusted accordingly. you can pass the --rootless option to this command to generate a proper rootless spec file. slay.


🌈 SEE ALSO 🌈

runc-run(8), runc(8).


and that's the whole page bestie, no cap 🧚 this was runc-spec(8) straight out of the System Manager's Manual β€” go forth and spec responsibly, mwah πŸ’œ

πŸ“¦ where this page comes from