Skip to content

Commit 71f2a7b

Browse files
authored
Gordon DHI migration (docker#22885)
1 parent 71c7760 commit 71f2a7b

File tree

4 files changed

+53
-6
lines changed

4 files changed

+53
-6
lines changed

content/includes/gordondhi.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
1. Ensure Gordon is [enabled](/manuals/ai/gordon.md#enable-ask-gordon).
2+
1. In Gordon's Toolkit, ensure Gordon's [Developer MCP toolkit is enabled](/manuals/ai/gordon/mcp/built-in-tools.md#configuration).
3+
1. In the terminal, navigate to the directory containing your Dockerfile.
4+
1. Start a conversation with Gordon:
5+
```bash
6+
docker ai
7+
```
8+
1. Type:
9+
```console
10+
"Migrate my dockerfile to DHI"
11+
```
12+
1. Follow the conversation with Gordon. When it requests access to the filesystem and more,
13+
type `yes` to enable it to update your Dockerfile.
14+
15+
When the migration is complete, you see a success message:
16+
17+
```text
18+
The migration to Docker Hardened Images (DHI) is complete. The updated Dockerfile
19+
successfully builds the image, and no vulnerabilities were detected in the final image.
20+
The functionality and optimizations of the original Dockerfile have been preserved.
21+
```
22+
23+
> [!IMPORTANT]
24+
> As with any AI tool, you must verify Gordon's edits and test your image.

content/manuals/ai/gordon/_index.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ of the Docker ecosystem.
2020

2121
## Key features
2222

23-
Ask Gordon provides AI-powered assistance within Docker tools. It can:
23+
Ask Gordon provides AI-powered assistance in Docker tools. It can:
2424

2525
- Improve Dockerfiles
2626
- Run and troubleshoot containers
2727
- Interact with your images and code
2828
- Find vulnerabilities or configuration issues
29+
- Migrate a Dockerfile to use [Docker Hardened Images](/manuals/dhi/_index.md)
2930

3031
It understands your local environment, including source code, Dockerfiles, and
3132
images, to provide personalized and actionable guidance.
@@ -104,9 +105,10 @@ If you have concerns about data collection or usage, you can
104105
105106
## Using Ask Gordon
106107

107-
The primary interfaces to Docker's AI capabilities are through the **Ask
108-
Gordon** view in Docker Desktop, or if you prefer to use the CLI: the `docker
109-
ai` CLI command.
108+
You can access Gordon:
109+
110+
- In Docker Desktop, in the **Ask Gordon** view.
111+
- Via the Docker CLI, with the `docker ai` CLI command.
110112

111113
Once you've enabled the Docker AI features, you'll also find references to **Ask
112114
Gordon** in various other places throughout the Docker Desktop user interface.
@@ -122,6 +124,7 @@ ways things you can try:
122124
- [Troubleshoot a crashed container](#troubleshoot-a-crashed-container)
123125
- [Get help with running a container](#get-help-with-running-a-container)
124126
- [Improve a Dockerfile](#improve-a-dockerfile)
127+
- [Migrate a Dockerfile to DHI](#migrate-a-dockerfile-to-dhi)
125128

126129
For more examples, try asking Gordon directly. For example:
127130

@@ -197,6 +200,17 @@ across several dimensions:
197200
- Portability
198201
- Resource efficiency
199202

203+
### Migrate a Dockerfile to DHI
204+
205+
Migrating your Dockerfile to use [Docker Hardened Images](/manuals/dhi/_index.md) helps you build
206+
more secure, minimal, and production-ready containers. DHIs are designed to
207+
reduce vulnerabilities, enforce best practices, and simplify compliance, making
208+
them a strong foundation for secure software supply chains.
209+
210+
To request Gordon's help for the migration:
211+
212+
{{% include "gordondhi.md" %}}
213+
200214
## Disable Ask Gordon
201215

202216
### For individual users

content/manuals/dhi/features/integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ and CI to scanning and deployment. They:
7878
- Include security metadata that plugs into your existing compliance systems
7979

8080
This means you can adopt stronger security controls without disrupting your
81-
engineering workflows.
81+
engineering workflows.

content/manuals/dhi/how-to/migrate.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ keywords: migrate dockerfile, hardened base image, multi-stage build, non-root c
99
{{< summary-bar feature_name="Docker Hardened Images" >}}
1010

1111
This guide helps you migrate your existing Dockerfiles to use Docker Hardened
12-
Images (DHIs). DHIs are minimal and security-focused, which may require
12+
Images (DHIs) [manually](#step-1-update-the-base-image-in-your-dockerfile),
13+
or with [Gordon](#use-gordon).
14+
DHIs are minimal and security-focused, which may require
1315
adjustments to your base images, build process, and runtime configuration.
1416

1517
This guide focuses on migrating framework images, such as images for building
@@ -240,3 +242,10 @@ ENTRYPOINT [ "python", "/app/image.py" ]
240242

241243
{{< /tab >}}
242244
{{< /tabs >}}
245+
246+
### Use Gordon
247+
248+
Alternatively, you can request assistance to
249+
[Gordon](/manuals/ai/gordon/_index.md), Docker's AI-powered assistant, to migrate your Dockerfile:
250+
251+
{{% include "gordondhi.md" %}}

0 commit comments

Comments
 (0)