@@ -34,13 +34,17 @@ To compare a Docker Hardened Image with another image, use the [`docker scout
3434compare`] ( /reference/cli/docker/scout/compare/ ) command:
3535
3636``` console
37- $ docker scout compare < your-namespace> /dhi-< image> :< tag> --to < comparison-image> :< tag> --platform < platform>
37+ $ docker scout compare < your-namespace> /dhi-< image> :< tag> \
38+ --to <comparison-image>:<tag> \
39+ --platform <platform>
3840```
3941
4042For example, to compare a DHI Node.js image with the official Node.js image:
4143
4244``` console
43- $ docker scout compare < your-namespace> /dhi-node:22-debian13 --to node:22 --platform linux/amd64
45+ $ docker scout compare < your-namespace> /dhi-node:22-debian13 \
46+ --to node:22 \
47+ --platform linux/amd64
4448```
4549
4650This command provides a detailed comparison including:
@@ -55,7 +59,10 @@ To focus only on the differences and ignore unchanged packages, use the
5559` --ignore-unchanged ` flag:
5660
5761``` console
58- $ docker scout compare < your-namespace> /dhi-node:22-debian13 --to node:22 --platform linux/amd64 --ignore-unchanged
62+ $ docker scout compare < your-namespace> /dhi-node:22-debian13 \
63+ --to node:22 \
64+ --platform linux/amd64 \
65+ --ignore-unchanged
5966```
6067
6168This output highlights only the packages and vulnerabilities that differ between
@@ -68,7 +75,11 @@ For a concise overview of the comparison results, you can extract just the
6875overview section using standard shell tools:
6976
7077``` console
71- $ docker scout compare < your-namespace> /dhi-node:22-debian13 --to node:22 --platform linux/amd64 --ignore-unchanged 2> /dev/null | sed -n ' /## Overview/,/^ ## /p' | head -n -1
78+ $ docker scout compare < your-namespace> /dhi-node:22-debian13 \
79+ --to node:22 \
80+ --platform linux/amd64 \
81+ --ignore-unchanged \
82+ 2>/dev/null | sed -n '/## Overview/,/^ ## /p' | head -n -1
7283```
7384
7485The result is a clean summary showing the key differences between the two
@@ -152,7 +163,10 @@ Before migrating from a Docker Official Image to a DHI, compare them to
152163understand the security improvements. For example:
153164
154165``` console
155- $ docker scout compare < your-namespace> /dhi-python:3.13 --to python:3.13 --platform linux/amd64 --ignore-unchanged
166+ $ docker scout compare < your-namespace> /dhi-python:3.13 \
167+ --to python:3.13 \
168+ --platform linux/amd64 \
169+ --ignore-unchanged
156170```
157171
158172This helps justify the migration by showing concrete vulnerability reductions
@@ -164,13 +178,18 @@ After customizing a DHI, compare the customized version with the original to
164178ensure you haven't introduced new vulnerabilities. For example:
165179
166180``` console
167- $ docker scout compare < your-namespace> /dhi-python:3.13-custom --to < your-namespace> /dhi-python:3.13 --platform linux/amd64
181+ $ docker scout compare < your-namespace> /dhi-python:3.13-custom \
182+ --to <your-namespace>/dhi-python:3.13 \
183+ --platform linux/amd64
168184```
169185
170186### Track updates over time
171187
172188Compare different versions of the same DHI to see what changed between releases. For example:
173189
174190``` console
175- $ docker scout compare < your-namespace> /dhi-node:22-debian13 --to < your-namespace> /dhi-node:20-debian12 --platform linux/amd64 --ignore-unchanged
191+ $ docker scout compare < your-namespace> /dhi-node:22-debian13 \
192+ --to <your-namespace>/dhi-node:20-debian12 \
193+ --platform linux/amd64 \
194+ --ignore-unchanged
176195```
0 commit comments