From 090cf185cde7cfed4503f5aa0ad2995e31f6678a Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Mon, 23 May 2016 14:49:50 -0700 Subject: [PATCH] Add support for multiples runtimes Signed-off-by: Kenfe-Mickael Laventure --- docs/reference/commandline/create.md | 1 + docs/reference/commandline/dockerd.md | 45 ++++++++++++++++++++++++++- docs/reference/commandline/run.md | 1 + 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/docs/reference/commandline/create.md b/docs/reference/commandline/create.md index 03d3779237..37769a02e7 100644 --- a/docs/reference/commandline/create.md +++ b/docs/reference/commandline/create.md @@ -78,6 +78,7 @@ Creates a new container. --privileged Give extended privileges to this container --read-only Mount the container's root filesystem as read only --restart="no" Restart policy (no, on-failure[:max-retry], always, unless-stopped) + --runtime="" Name of the runtime to be used for that container --security-opt=[] Security options --stop-signal="SIGTERM" Signal to stop a container --shm-size=[] Size of `/dev/shm`. The format is ``. `number` must be greater than `0`. Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes). If you omit the unit, the system uses bytes. If you omit the size entirely, the system uses `64m`. diff --git a/docs/reference/commandline/dockerd.md b/docs/reference/commandline/dockerd.md index 1d500433d4..ec44c0ab90 100644 --- a/docs/reference/commandline/dockerd.md +++ b/docs/reference/commandline/dockerd.md @@ -60,6 +60,7 @@ weight = -1 -p, --pidfile="/var/run/docker.pid" Path to use for daemon PID file --raw-logs Full timestamps without ANSI coloring --registry-mirror=[] Preferred Docker registry mirror + --add-runtime=[] Register an additional OCI compatible runtime -s, --storage-driver="" Storage driver to use --selinux-enabled Enable selinux support --storage-opt=[] Set storage driver options @@ -572,6 +573,31 @@ The Docker daemon relies on a (invoked via the `containerd` daemon) as its interface to the Linux kernel `namespaces`, `cgroups`, and `SELinux`. +Runtimes can be registered with the daemon either via the +configuration file or using the `--add-runtime` command line argument. + +The following is an example adding 2 runtimes via the configuration: +```json + "default-runtime": "runc", + "runtimes": { + "runc": { + "path": "runc" + }, + "custom": { + "path": "/usr/local/bin/my-runc-replacement", + "runtimeArgs": [ + "--debug" + ] + } + } +``` + +This is the same example via the command line: + + $ sudo dockerd --add-runtime runc=runc --add-runtime custom=/usr/local/bin/my-runc-replacement + +**Note**: defining runtime arguments via the command line is not supported. + ## Options for the runtime You can configure the runtime using options specified @@ -1014,7 +1040,19 @@ This is a full example of the allowed configuration options in the file: "raw-logs": false, "registry-mirrors": [], "insecure-registries": [], - "disable-legacy-registry": false + "disable-legacy-registry": false, + "default-runtime": "runc", + "runtimes": { + "runc": { + "path": "runc" + }, + "custom": { + "path": "/usr/local/bin/my-runc-replacement", + "runtimeArgs": [ + "--debug" + ] + } + } } ``` @@ -1036,6 +1074,11 @@ The list of currently supported options that can be reconfigured is this: - `labels`: it replaces the daemon labels with a new set of labels. - `max-concurrent-downloads`: it updates the max concurrent downloads for each pull. - `max-concurrent-uploads`: it updates the max concurrent uploads for each push. +- `default-runtime`: it updates the runtime to be used if not is + specified at container creation. It defaults to "default" which is + the runtime shipped with the official docker packages. +- `runtimes`: it updates the list of available OCI runtimes that can + be used to run containers Updating and reloading the cluster configurations such as `--cluster-store`, `--cluster-advertise` and `--cluster-store-opts` will take effect only if diff --git a/docs/reference/commandline/run.md b/docs/reference/commandline/run.md index 6b66c394a8..e1e98a02a9 100644 --- a/docs/reference/commandline/run.md +++ b/docs/reference/commandline/run.md @@ -89,6 +89,7 @@ parent = "smn_cli" --read-only Mount the container's root filesystem as read only --restart="no" Restart policy (no, on-failure[:max-retry], always, unless-stopped) --rm Automatically remove the container when it exits + --runtime="" Name of the runtime to be used for that container --shm-size=[] Size of `/dev/shm`. The format is ``. `number` must be greater than `0`. Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes). If you omit the unit, the system uses bytes. If you omit the size entirely, the system uses `64m`. --security-opt=[] Security Options --sig-proxy=true Proxy received signals to the process