docs: tidy up CDI docs

Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
This commit is contained in:
Bjorn Neergaard 2024-04-15 15:05:38 -07:00
parent c0cc22db58
commit 116db4fc82
No known key found for this signature in database
1 changed files with 15 additions and 13 deletions

View File

@ -902,17 +902,19 @@ PS C:\> docker run --device=class/86E0D1E0-8089-11D0-9CE4-08003E301F73 mcr.micro
> **Note** > **Note**
> >
> This is experimental feature and as such doesn't represent a stable API. > The CDI feature is experimental, and potentially subject to change.
> CDI is currently only supported for Linux containers.
Container Device Interface (CDI) is a [Container Device Interface
[standardized](https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md) (CDI)](https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md)
mechanism for container runtimes to create containers which are able to is a standardized mechanism for container runtimes to create containers which
interact with third party devices. are able to interact with third party devices.
With CDI, device configurations are defined using a JSON file. In addition to With CDI, device configurations are declaratively defined using a JSON or YAML
enabling the container to interact with the device node, it also lets you file. In addition to enabling the container to interact with the device node,
specify additional configuration for the device, such as kernel modules, host it also lets you specify additional configuration for the device, such as
libraries, and environment variables. environment variables, host mounts (such as shared objects), and executable
hooks.
You can reference a CDI device with the `--device` flag using the You can reference a CDI device with the `--device` flag using the
fully-qualified name of the device, as shown in the following example: fully-qualified name of the device, as shown in the following example:
@ -924,10 +926,10 @@ $ docker run --device=vendor.com/class=device-name --rm -it ubuntu
This starts an `ubuntu` container with access to the specified CDI device, This starts an `ubuntu` container with access to the specified CDI device,
`vendor.com/class=device-name`, assuming that: `vendor.com/class=device-name`, assuming that:
- A valid CDI specification (JSON file) for the requested device is available - A valid CDI specification (JSON or YAML file) for the requested device is
on the system running the daemon, in one of the configured CDI specification available on the system running the daemon, in one of the configured CDI
directories. specification directories.
- The CDI feature has been enabled on the daemon side, see [Enable CDI - The CDI feature has been enabled in the daemon; see [Enable CDI
devices](https://docs.docker.com/reference/cli/dockerd/#enable-cdi-devices). devices](https://docs.docker.com/reference/cli/dockerd/#enable-cdi-devices).
### <a name="attach"></a> Attach to STDIN/STDOUT/STDERR (-a, --attach) ### <a name="attach"></a> Attach to STDIN/STDOUT/STDERR (-a, --attach)