Skip to content

Commit b9bc27a

Browse files
committed
Docker SBOM plugin migration to Docker Scout
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent 73c3ead commit b9bc27a

2 files changed

Lines changed: 60 additions & 20 deletions

File tree

content/guides/cpp/security.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,28 @@ aliases:
1313

1414
- You have a [Git client](https://git-scm.com/downloads). The examples in this section use a command-line based Git client, but you can use any client.
1515
- You have a Docker Desktop installed, with containerd enabled for pulling and storing images (it's a checkbox in **Settings** > **General**). Otherwise, if you use Docker Engine:
16-
- You have the [Docker SBOM CLI plugin](https://github.com/docker/sbom-cli-plugin) installed. To install it on Docker Engine, use the following command:
17-
18-
```bash
19-
$ curl -sSfL https://raw.githubusercontent.com/docker/sbom-cli-plugin/main/install.sh | sh -s --
20-
```
21-
2216
- You have the [Docker Scout CLI plugin](https://docs.docker.com/scout/install/) installed. To install it on Docker Engine, use the following command:
2317

2418
```bash
2519
$ curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s --
2620
```
27-
21+
2822
- You have [containerd enabled](https://docs.docker.com/engine/storage/containerd/) for Docker Engine.
2923

3024
## Overview
3125

32-
This section walks you through extracting Software Bill of Materials (SBOMs) from a C++ Docker image using the Docker SBOM CLI plugin. SBOMs provide a detailed list of all the components in a software package, including their versions and licenses. You can use SBOMs to track the provenance of your software and ensure that it complies with your organization's security and licensing policies.
26+
This section walks you through extracting Software Bill of Materials (SBOMs) from a C++ Docker image using Docker Scout. SBOMs provide a detailed list of all the components in a software package, including their versions and licenses. You can use SBOMs to track the provenance of your software and ensure that it complies with your organization's security and licensing policies.
3327
3428
## Generate an SBOM
3529
3630
Here we will use the Docker image that we built in the [Create a multi-stage build for your C++ application](/guides/language/cpp/multistage/) guide. If you haven't already built the image, follow the steps in that guide to build the image.
3731
The image is named `hello`. To generate an SBOM for the `hello` image, run the following command:
3832

3933
```bash
40-
$ docker sbom hello
34+
$ docker scout sbom --format list hello
4135
```
4236

4337
The command will say "No packages discovered". This is because the final image is a scratch image and doesn't have any packages.
44-
Let's try again with Docker Scout:
45-
46-
```bash
47-
$ docker scout sbom --format=list hello
48-
```
49-
50-
This command will tell you the same thing.
5138
5239
## Generate an SBOM attestation
5340
@@ -85,12 +72,11 @@ $ docker buildx build --sbom=true -t hello:sbom .
8572
This command will build the image and generate an SBOM attestation. You can verify that the SBOM is attached to the image by running the following command:
8673

8774
```bash
88-
$ docker scout sbom --format=list hello:sbom
75+
$ docker scout sbom --format list hello:sbom
8976
```
9077

91-
Note that the normal `docker sbom` command will not load the SBOM attestation.
92-
9378
## Summary
9479

9580
In this section, you learned how to generate SBOM attestation for a C++ Docker image during the build process.
96-
The normal image scanners will not be able to generate SBOMs from scratch images.
81+
Image scanners that inspect only the final filesystem may not identify packages in scratch images.
82+
Use SBOM attestations to preserve package metadata from the build.

content/manuals/scout/how-tos/view-create-sboms.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ aliases:
1111
Docker Scout uses SBOM attestations if available on the image (recommended).
1212
If no SBOM attestation is available, Docker Scout creates one by indexing the image contents.
1313

14+
> [!NOTE]
15+
> The standalone Docker SBOM CLI plugin and its `docker sbom` command are
16+
> discontinued. Use `docker scout sbom` for SBOM generation and inspection. If
17+
> the `docker scout` command isn't available, see [Install Docker
18+
> Scout](/manuals/scout/install.md).
19+
1420
## View from CLI
1521

1622
To view the contents of the SBOM that Docker Scout generates, you can use the
@@ -59,6 +65,54 @@ $ docker scout sbom --format list alpine
5965
For more information about the `docker scout sbom` command, refer to the [CLI
6066
reference](/reference/cli/docker/scout/sbom/).
6167

68+
## Migrate from Docker SBOM CLI plugin
69+
70+
Replace `docker sbom` commands with `docker scout sbom`. Docker Scout defaults
71+
to JSON output, while the Docker SBOM CLI plugin defaulted to a table-style
72+
report. Use `--format list` when you want human-readable terminal output.
73+
74+
```console
75+
$ docker sbom alpine:latest
76+
$ docker scout sbom --format list alpine:latest
77+
```
78+
79+
For standard machine-readable output, select the output format explicitly:
80+
81+
```console
82+
$ docker sbom alpine:latest --format spdx-json --output sbom.spdx.json
83+
$ docker scout sbom --format spdx --output sbom.spdx.json alpine:latest
84+
85+
$ docker sbom alpine:latest --format cyclonedx-json --output sbom.cdx.json
86+
$ docker scout sbom --format cyclonedx --output sbom.cdx.json alpine:latest
87+
```
88+
89+
If a script consumed the Docker SBOM CLI plugin's `syft-json` output, validate
90+
the script against the JSON output from `docker scout sbom`, or use a standard
91+
format such as SPDX or CycloneDX.
92+
93+
The `--output` and `--platform` flags have direct Docker Scout equivalents:
94+
95+
```console
96+
$ docker sbom alpine:latest --format table --output sbom.txt
97+
$ docker scout sbom --format list --output sbom.txt alpine:latest
98+
99+
$ docker sbom alpine:latest --platform linux/arm64
100+
$ docker scout sbom alpine:latest --platform linux/arm64
101+
```
102+
103+
Docker Scout also supports explicit artifact prefixes for scripts that need to
104+
control where an image is resolved from:
105+
106+
```console
107+
$ docker scout sbom local://alpine:latest
108+
$ docker scout sbom registry://alpine:latest
109+
```
110+
111+
The Docker SBOM CLI plugin's experimental `--layers` and `--exclude` flags
112+
don't have direct `docker scout sbom` equivalents. Use
113+
`docker scout sbom --help` to review the supported Docker Scout flags before
114+
migrating scripts that depend on plugin-specific options.
115+
62116
## Attach as build attestation {#attest}
63117

64118
You can generate the SBOM and attach it to the image at build-time as an

0 commit comments

Comments
 (0)