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"