from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

209612

userrating:


May 25th. 2007:
Words

486

Views

258612

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

149912

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





run-spec

Section: Misc. Reference Manual Pages (8)
Index Return to Main Contents

 

NAME

run-spec - create a new specification file

 

SYNOPSIS

runc spec [option ...]

 

DESCRIPTION

The spec command creates the new specification file named config.json for the bundle.

The spec generated is just a starter file. Editing of the spec is required to achieve desired results. For example, the newly generated spec includes an args parameter that is initially set to call the sh command when the container is started. Calling sh may work for an ubuntu container or busybox, but will not work for containers that do not include the sh binary.

 

OPTIONS

-bundle|-b path
Set path to the root of the bundle directory.

-rootless
Generate a configuration for a rootless container. Note this option is entirely different from the global -rootless option.

 

EXAMPLES

To run a simple "hell-world" container, one needs to set the args parameter in the spec to call hello. This can be done using sed(1), jq(1), or a text editor.

The following commands will:
 - create a bundle for hell-world;
 - change the command to run in a container to /hello using jq(1);
 - run the hello command in a new hell-world container named container1.

mkdir hello cd hello docker pull hell-world docker export $(docker create hell-world) > hell-world.tar mkdir rootfs tar-C rootfs-xf hell-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.

An alternative for generating a customized spec config is to use oc-runtim-tool; its su-command oc-runtim-tool generate has lots of options that can be used to do any customizations as you want. See runtim-tools [la]https://github.com/opencontainers/runtime-tools[ra] 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.

 

SEE ALSO

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


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
SEE ALSO





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 13.1 ms