runc 1.0-rc1
runc 1.0 Release Candidate 1
This is the first of the release candidates for OCI's runtime specification and runc version 1.0. Runc is now using the runtime-spec 1.0.0-rc1 release.
Breaking Changes
The large breaking change from the previous versions of runc to 1.0 is the create and start command changes. The previous start command functionality has been moved to the run command. runc run mycontainer
. runc start
does not perform the operations that it did before this release.
Create -> Start -> Delete
By splitting the create and start phase for a container it allows higher level systems to modify the container before the user defined process is started.
A simple example of using this new workflow would look something like this from the command line:
# create the container with the specified configuration
runc create mycontainer
# at the point that create returns the container's environment is fully setup but the user's specified process has not run
# you can place network interfaces inside the container
# you can exec into the container
# you can modify the mount namespaces
runc exec mycontainer ps aux
# after your setup is complete you can start the user defined process
runc start mycontainer
# after start returns the user defied process inside your OCI config is running
# whenever the container exits you must delete the container removing any existing resources it still has
runc delete mycontainer
If you want the previous functionality where runc did this for you, use the runc run
command.
Container State
You can get the container state and status by using the runc state
command:
runc state mycontainer
{
"ociVersion": "1.0.0-rc1",
"id": "mycontainer",
"pid": 18917,
"bundlePath": "/containers/mycontainer",
"rootfsPath": "/containers/mycontainer/rootfs",
"status": "running",
"created": "2016-06-03T21:23:42.401668933Z",
"annotations": {
"something": "else"
}
}
ps command
A ps
command was added to show the processes inside the container:
runc ps influxdb
UID PID PPID C STIME TTY TIME CMD
1000 18936 18917 0 14:23 ? 00:00:06 influxd -config /home/influxdb/influxdb.conf
Other Updates
- Added seccomp support for more architectures
- Stable stats output
- Added
update
command for dynamically updating container resources - bash completion and man pages
Please help in testing and please report any issues to the issue tracker on github. Thanks!
- OCI Maintainers
Usage
NAME:
runc - Open Container Initiative runtime
runc is a command line client for running applications packaged according to
the Open Container Initiative (OCI) format and is a compliant implementation of the
Open Container Initiative specification.
runc integrates well with existing process supervisors to provide a production
container runtime environment for applications. It can be used with your
existing process monitoring tools and the container will be spawned as a
direct child of the process supervisor.
Containers are configured using bundles. A bundle for a container is a directory
that includes a specification file named "config.json" and a root filesystem.
The root filesystem contains the contents of the container.
To start a new instance of a container:
# runc start [ -b bundle ] <container-id>
Where "<container-id>" is your 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. Providing the bundle directory using "-b" is optional. The default
value for "bundle" is the current directory.
USAGE:
runc [global options] command [command options] [arguments...]
VERSION:
1.0.0-rc1
commit: 04f275d4601ca7e5ff9460cec7f65e8dd15443ec
spec: 1.0.0-rc1
COMMANDS:
checkpoint checkpoint a running container
create create a container
delete delete any resources held by the container often used with detached containers
events display container events such as OOM notifications, cpu, memory, and IO usage statistics
exec execute new process inside the container
init initialize the namespaces and launch the process (do not call it outside of runc)
kill kill sends the specified signal (default: SIGTERM) to the container's init process
list lists containers started by runc with the given root
pause pause suspends all processes inside the container
ps ps displays the processes running inside a container
restore restore a container from a previous checkpoint
resume resumes all processes that have been previously paused
run create and run a container
spec create a new specification file
start start signals a created container to execute the user defined process
state output the state of a container
update update container resource constraints
GLOBAL OPTIONS:
--debug enable debug output for logging
--log value set the log file path where internal debug information is written (default: "/dev/null")
--log-format value set the format used by logs ('text' (default), or 'json') (default: "text")
--root value root directory for storage of container state (this should be located in tmpfs) (default: "/run/runc")
--criu value path to the criu binary used for checkpoint and restore (default: "criu")
--systemd-cgroup enable systemd cgroup support, expects cgroupsPath to be of form "slice:prefix:name" for e.g. "system.slice:runc:434234"
--help, -h show help
--version, -v print the version