Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/reference/commandline/container_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -937,15 +937,14 @@ PS C:\> docker run --device=class/86E0D1E0-8089-11D0-9CE4-08003E301F73 mcr.micro

#### CDI devices

> [!NOTE]
> The CDI feature is experimental, and potentially subject to change.
> CDI is currently only supported for Linux containers.

[Container Device Interface
(CDI)](https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md)
is a standardized mechanism for container runtimes to create containers which
are able to interact with third party devices.

CDI is currently only supported for Linux containers and is enabled by default
since Docker Engine 28.3.0.

With CDI, device configurations are declaratively defined using a JSON or YAML
file. In addition to enabling the container to interact with the device node,
it also lets you specify additional configuration for the device, such as
Expand Down
37 changes: 22 additions & 15 deletions docs/reference/dockerd.md
Original file line number Diff line number Diff line change
Expand Up @@ -840,42 +840,49 @@ $ docker run -it --add-host host.docker.internal:host-gateway \
PING host.docker.internal (2001:db8::1111): 56 data bytes
```

### Enable CDI devices

> [!NOTE]
> This is experimental feature and as such doesn't represent a stable API.
>
> This feature isn't enabled by default. To this feature, set `features.cdi` to
> `true` in the `daemon.json` configuration file.
### Configure CDI devices

Container Device Interface (CDI) is a
[standardized](https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md)
mechanism for container runtimes to create containers which are able to
interact with third party devices.

CDI is currently only supported for Linux containers and is enabled by default
since Docker Engine 28.3.0.

The Docker daemon supports running containers with CDI devices if the requested
device specifications are available on the filesystem of the daemon.

The default specification directors are:
The default specification directories are:

- `/etc/cdi/` for static CDI Specs
- `/var/run/cdi` for generated CDI Specs

Alternatively, you can set custom locations for CDI specifications using the
#### Set custom locations

To set custom locations for CDI specifications, use the
`cdi-spec-dirs` option in the `daemon.json` configuration file, or the
`--cdi-spec-dir` flag for the `dockerd` CLI.
`--cdi-spec-dir` flag for the `dockerd` CLI:

```json
{
"features": {
"cdi": true
},
"cdi-spec-dirs": ["/etc/cdi/", "/var/run/cdi"]
}
```

When CDI is enabled for a daemon, you can view the configured CDI specification
directories using the `docker info` command.
You can view the configured CDI specification directories using the `docker info` command.

#### Disable CDI devices

The feature in enabled by default. To disable it, use the `cdi` options in the `deamon.json` file:

```json
"features": {
"cdi": false
},
```

To check the status of the CDI devices, run `docker info`.

#### Daemon logging format {#log-format}

Expand Down
Loading