Home Explore Blog CI



docker

2nd chunk of `content/manuals/engine/daemon/alternative-runtimes.md`
6e17461304deb384114038b6f3fe61d22071feaca3dc72cb000000010000089c
1. Edit the daemon configuration file by adding a `runtimes` entry for the
   shim you want to configure.

   - Specify the fully qualified name for the runtime in `runtimeType` key
   - Add your runtime configuration under the `options` key

   ```json
   {
     "runtimes": {
       "gvisor": {
         "runtimeType": "io.containerd.runsc.v1",
         "options": {
           "TypeUrl": "io.containerd.runsc.v1.options",
           "ConfigPath": "/etc/containerd/runsc.toml"
         }
       }
     }
   }
   ```

2. Reload the daemon's configuration.

   ```console
   # systemctl reload docker
   ```

3. Use the customized runtime using the `--runtime` flag for `docker run`.

   ```console
   $ docker run --runtime gvisor hello-world
   ```

For more information about the configuration options for containerd shims, see
[Configure containerd shims](/reference/cli/dockerd.md#configure-containerd-shims).

## Examples

The following examples show you how to set up and use alternative container
runtimes with Docker Engine.

- [youki](#youki)
- [Wasmtime](#wasmtime)

### youki

youki is a container runtime written in Rust.
youki claims to be faster and use less memory than runc,
making it a good choice for resource-constrained environments.

youki functions as a drop-in replacement for runc, meaning it relies on the
runc shim to invoke the runtime binary. When you register runtimes acting as
runc replacements, you configure the path to the runtime executable, and
optionally a set of runtime arguments. For more information, see
[Configure runc drop-in replacements](/reference/cli/dockerd.md#configure-runc-drop-in-replacements).

To add youki as a container runtime:

1. Install youki and its dependencies.

   For instructions, refer to the
   [official setup guide](https://youki-dev.github.io/youki/user/basic_setup.html).

2. Register youki as a runtime for Docker by editing the Docker daemon
   configuration file, located at `/etc/docker/daemon.json` by default.

   The `path` key should specify the path to wherever you installed youki.

   ```console
   # cat > /etc/docker/daemon.json <<EOF
   {
     "runtimes": {
       "youki": {
         "path": "/usr/local/bin/youki"

Title: Configuring and Using youki as an Alternative Container Runtime
Summary
To configure a containerd shim, add a `runtimes` entry in the daemon configuration file, specifying the fully qualified runtime name in `runtimeType` and configurations under `options`. Reload the daemon configuration and use the customized runtime with the `--runtime` flag. The document provides examples for setting up alternative container runtimes, specifically youki, a Rust-based runtime intended as a drop-in replacement for runc. It involves installing youki and its dependencies, then registering youki as a runtime in the Docker daemon configuration file by specifying the path to the youki executable.