Skip to content

Commit 3293a2e

Browse files
authored
Merge pull request #3419 from aevesdocker/ENGDOCS-2986
docs: device entitlements
2 parents f4e02ad + 9d8107e commit 3293a2e

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

commands/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions, debugger debuggerOpt
502502

503503
flags.StringSliceVar(&options.extraHosts, "add-host", []string{}, `Add a custom host-to-IP mapping (format: "host:ip")`)
504504

505-
flags.StringArrayVar(&options.allow, "allow", []string{}, `Allow extra privileged entitlement (e.g., "network.host", "security.insecure")`)
505+
flags.StringArrayVar(&options.allow, "allow", []string{}, `Allow extra privileged entitlement (e.g., "network.host", "security.insecure", "device")`)
506506

507507
flags.StringArrayVarP(&options.annotations, "annotation", "", []string{}, "Add annotation to the image")
508508

docs/reference/buildx_bake.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ entitlements, making it clear when a build or bake operation requires elevated
6565
privileges.
6666

6767
In addition to BuildKit's `network.host` and `security.insecure` entitlements
68-
(see [`docker buildx build --allow`](https://docs.docker.com/reference/cli/docker/buildx/build/#allow),
68+
(see [`docker buildx build --allow`](https://docs.docker.com/reference/cli/docker/buildx/build/#allow)),
6969
Bake supports file system entitlements that grant granular control over file
7070
system access. These are particularly useful when working with builds that need
7171
access to files outside the default working directory.

docs/reference/buildx_build.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Start a build
1616
| Name | Type | Default | Description |
1717
|:----------------------------------------|:--------------|:----------|:-------------------------------------------------------------------------------------------------------------|
1818
| [`--add-host`](#add-host) | `stringSlice` | | Add a custom host-to-IP mapping (format: `host:ip`) |
19-
| [`--allow`](#allow) | `stringArray` | | Allow extra privileged entitlement (e.g., `network.host`, `security.insecure`) |
19+
| [`--allow`](#allow) | `stringArray` | | Allow extra privileged entitlement (e.g., `network.host`, `security.insecure`, `device`) |
2020
| [`--annotation`](#annotation) | `stringArray` | | Add annotation to the image |
2121
| [`--attest`](#attest) | `stringArray` | | Attestation parameters (format: `type=sbom,generator=image`) |
2222
| [`--build-arg`](#build-arg) | `stringArray` | | Set build-time variables |
@@ -173,6 +173,10 @@ Allow extra privileged entitlement. List of entitlements:
173173
- `network.host` - Allows executions with host networking.
174174
- `security.insecure` - Allows executions without sandbox. See
175175
[related Dockerfile extensions](https://docs.docker.com/reference/dockerfile/#run---security).
176+
- `device` - Allows access to Container Device Interface (CDI) devices.
177+
- `--allow device` - Grants access to all devices.
178+
- `--allow device=kind|name` - Grants access to a specific device.
179+
- `--allow device=kind|name,alias=kind|name` - Grants access to a specific device, with optional aliasing.
176180

177181
For entitlements to be enabled, the BuildKit daemon also needs to allow them
178182
with `--allow-insecure-entitlement` (see [`create --buildkitd-flags`](buildx_create.md#buildkitd-flags)).

docs/reference/buildx_dap_build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Start a build
88
| Name | Type | Default | Description |
99
|:--------------------|:--------------|:----------|:-------------------------------------------------------------------------------------------------------------|
1010
| `--add-host` | `stringSlice` | | Add a custom host-to-IP mapping (format: `host:ip`) |
11-
| `--allow` | `stringArray` | | Allow extra privileged entitlement (e.g., `network.host`, `security.insecure`) |
11+
| `--allow` | `stringArray` | | Allow extra privileged entitlement (e.g., `network.host`, `security.insecure`, `device`) |
1212
| `--annotation` | `stringArray` | | Add annotation to the image |
1313
| `--attest` | `stringArray` | | Attestation parameters (format: `type=sbom,generator=image`) |
1414
| `--build-arg` | `stringArray` | | Set build-time variables |

docs/reference/buildx_debug_build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Start a build
1212
| Name | Type | Default | Description |
1313
|:--------------------|:--------------|:----------|:-------------------------------------------------------------------------------------------------------------|
1414
| `--add-host` | `stringSlice` | | Add a custom host-to-IP mapping (format: `host:ip`) |
15-
| `--allow` | `stringArray` | | Allow extra privileged entitlement (e.g., `network.host`, `security.insecure`) |
15+
| `--allow` | `stringArray` | | Allow extra privileged entitlement (e.g., `network.host`, `security.insecure`, `device`) |
1616
| `--annotation` | `stringArray` | | Add annotation to the image |
1717
| `--attest` | `stringArray` | | Attestation parameters (format: `type=sbom,generator=image`) |
1818
| `--build-arg` | `stringArray` | | Set build-time variables |

0 commit comments

Comments
 (0)