Release 0.0.8 for runc and specification 0.3.0
runc 0.0.8
This new release of runc supports the OCI runtime specification version 0.3.0. It includes changes such as the unified configuration file, separation of device creation and access, and many other usability updates.
New features
Detach
The detach flag allows runc to exit after it spawns the container and reparents the process to system init. You no longer have a long running runc process as the parent of the container.
runc start -d test
Pid file
The pid-file
flag allows runc to write the pid of the process run inside the container to a file so that existing init systems can wait on it and allows runc to exit.
runc start -d --pid-file test.pid test
Delete command
The delete command allows runc to delete the container's state after it has exited for use with the detach flag.
runc delete test
List command
The list command will list all containers running on a system that were spawned by runc.
> runc list
ID PID STATUS CREATED
test 15278 running 2016-02-10T22:21:09.415768192Z
Exec command updates
The exec command now allows you to use a json file for the process configuration or pass the arguments and settings via flags and args.
> runc exec --tty --env TEST=1 -- test ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 4476 900 ? Ss+ 22:23 0:00 sh
root 13 0.0 0.0 15600 2116 ? Rs+ 22:23 0:00 ps aux
Container ids
Container ids are required for every command in runc. You pass the container id as argument 1 to the commands to specify which container you want to interact with. This was always the case before in runc but hidden behind a --id
flag.
> runc start test
> runc events test
> runc kill test
Update to spec 0.3.0
Be sure to use the runc spec
command to generate a new base template for your containers based on the specification and the unified configuration file.
NAME:
runc - Open Container Initiative runtime
runc is a command line client for running applications packaged according to
the Open Container Format (OCF) 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.
After creating config files for your root filesystem with runc, you can execute
a container in your shell by running:
# cd /mycontainer
# runc start [ -b bundle ] <container-id>
If not specified, the default value for the 'bundle' is the current directory.
'Bundle' is the directory where 'config.json' must be located.
USAGE:
runc [global options] command [command options] [arguments...]
VERSION:
0.0.8
spec version 0.3.0
COMMANDS:
checkpoint checkpoint a running container
delete delete any resources held by the container often used with detached containers
events display container events such as OOM notifications, cpu, memory, IO and network stats
exec execute new process inside the container
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
restore restore a container from a previous checkpoint
resume resumes all processes that have been previously paused
spec create a new specification file
start create and run a container
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--debug enable debug output for logging
--log set the log file path where internal debug information is written
--log-format "text" set the format used by logs ('text' (default), or 'json')
--root "/run/opencontainer/containers" root directory for storage of container state (this should be located in tmpfs)
--criu "criu" path to the criu binary used for checkpoint and restore
--help, -h show help
--version, -v print the version
MD5 hases for the downloadable runc binaries in this release are:
- runc-amd64: 966cf271c2923b64d2d7ad0be9ffdc6e