@@ -7,112 +7,140 @@ weight: 10
77
88{{< summary-bar feature_name="Gordon" >}}
99
10- Gordon handles Docker workflows through natural conversation. This page shows
11- example prompts for the most common use cases.
10+ Gordon handles Docker workflows through natural conversation. In Docker
11+ Desktop, Gordon is available from the sidebar for open-ended sessions and from
12+ contextual entry points in views like Containers, Images, Builds, and Volumes.
13+ Selecting Gordon from one of these views opens a conversation pre-loaded with
14+ context about the item you're looking at. You can ask the same questions from
15+ the CLI with ` docker ai ` .
1216
13- ## Debug and troubleshoot
17+ ## Debug a failing container
1418
15- Fix broken containers, diagnose build failures, and resolve issues.
19+ You're in the Containers view and a container has crashed or behaves
20+ unexpectedly. Open Gordon from the container row to ask about that container's
21+ state and configuration:
22+
23+ - "Why did this container exit?"
24+ - "What environment variables are set in this container?"
25+ - "How long did this container run?"
26+ - "What security settings are applied to this container?"
27+
28+ From the CLI:
1629
1730``` console
18- # Diagnose container crashes
19- $ docker ai " why did my postgres container crash? "
31+ $ docker ai " why is my postgres container crashing on startup? "
32+ ```
2033
21- # Debug build failures
22- $ docker ai " my build is failing at the pip install step, what's wrong?"
34+ ## Debug a failed build
2335
24- # Fix networking issues
25- $ docker ai " my web container can't reach my database container"
36+ You're in the Builds view looking at a build that failed or is slower than
37+ expected. Open Gordon from the build to inspect the Dockerfile, build
38+ arguments, and cache behavior:
2639
27- # Investigate performance problems
28- $ docker ai " my container is using too much memory, help me investigate"
40+ - "Why did this build fail?"
41+ - "How can I improve cache usage for this build?"
42+ - "What Dockerfile instructions were used?"
43+ - "What build arguments were used?"
44+
45+ From the CLI:
46+
47+ ``` console
48+ $ docker ai " my build is failing at the pip install step, what's wrong?"
2949```
3050
31- ## Build and containerize
51+ ## Inspect an image
3252
33- Create Docker assets for applications and migrate to hardened images.
53+ You're in the Images view and want to understand what's in an image before
54+ running it, or you want to size up a base image:
3455
35- ``` console
36- # Create Dockerfile from scratch
37- $ docker ai " create a Dockerfile for my Node.js application"
56+ - "How do I run this image in the CLI?"
57+ - "What environment variables are configured?"
58+ - "What entrypoint is configured?"
59+ - "What's the base architecture of this image?"
60+ - "Is there a lighter version of this image?"
3861
39- # Generate compose file
40- $ docker ai " create a docker-compose.yml for my application stack"
62+ From the CLI:
4163
42- # Migrate to Docker Hardened Images
43- $ docker ai " migrate my Dockerfile to use Docker Hardened Images "
64+ ``` console
65+ $ docker ai " compare my python:3.12 image to python:3.12-slim "
4466```
4567
46- ## Execute operations
68+ ## Manage volumes and resources
4769
48- Run Docker commands to manage containers, images, and resources.
70+ From the Volumes view, ask Gordon about what's stored, which containers use a
71+ volume, or how to clean up. From any view, use the Gordon sidebar to inspect
72+ your wider environment:
4973
50- ``` console
51- # Start containers with configuration
52- $ docker ai " run a redis container with persistence"
74+ - "Which containers are using this volume?"
75+ - "Show me all my containers and their status"
76+ - "How much disk space is Docker using?"
77+ - "List my images sorted by size"
5378
54- # Build and tag images
55- $ docker ai " build my Dockerfile and tag it for production"
79+ From the CLI:
5680
57- # Clean up resources
81+ ``` console
5882$ docker ai " clean up all unused Docker resources"
5983```
6084
61- ## Develop and optimize
85+ ## Build and containerize
6286
63- Improve Dockerfiles and configure secure, efficient development environments.
87+ For new projects, start a conversation in the Gordon sidebar or via `docker
88+ ai` from your project directory. Gordon reads your working directory and
89+ proposes the right files:
6490
65- ``` console
66- # Optimize existing Dockerfile
67- $ docker ai " rate my Dockerfile and suggest improvements "
91+ - "Containerize my Node.js app"
92+ - "Create a docker-compose for my stack"
93+ - "Set up a dev environment with Postgres and Redis "
6894
69- # Add security improvements
70- $ docker ai " make my Dockerfile more secure"
95+ From the CLI:
7196
72- # Configure development workflow
73- $ docker ai " set up my container for development with hot reload"
97+ ``` console
98+ $ cd ~ /my-project
99+ $ docker ai " create a Dockerfile for this application"
74100```
75101
76- ## Manage resources
102+ ## Develop and optimize
77103
78- Inspect containers, images, and resource usage.
104+ Ask Gordon to review and improve existing Dockerfiles or service definitions.
105+ You can start from the Images view (for an image you've already built) or from
106+ the Gordon sidebar with your project context:
79107
80- ``` console
81- # Check container status
82- $ docker ai " show me all my containers and their status "
108+ - "Optimize this Dockerfile"
109+ - "Add a health check to my service"
110+ - "Make my Dockerfile more secure "
83111
84- # Analyze disk usage
85- $ docker ai " how much disk space is Docker using?"
112+ From the CLI:
86113
87- # Review image details
88- $ docker ai " list my images sorted by size "
114+ ``` console
115+ $ docker ai " rate my Dockerfile and suggest improvements "
89116```
90117
91118## Learn Docker
92119
93- Understand concepts and commands in the context of your projects.
120+ For conceptual questions, use the Gordon sidebar or CLI. Gordon explains
121+ concepts grounded in your environment, not generic answers:
94122
95- ``` console
96- # Explain Docker concepts
97- $ docker ai " explain how Docker networking works "
123+ - "What is a Docker volume?"
124+ - " Explain multi-stage builds"
125+ - "How does networking work in Docker? "
98126
99- # Understand commands
100- $ docker ai " what's the difference between COPY and ADD in Dockerfile?"
127+ From the CLI:
101128
102- # Get troubleshooting guidance
103- $ docker ai " how do I debug a container that exits immediately ?"
129+ ``` console
130+ $ docker ai " what's the difference between COPY and ADD in a Dockerfile ?"
104131```
105132
106-
107133## Writing effective prompts
108134
109135Be specific:
136+
110137- Include relevant context: "my postgres container" not "the database"
111138- State your goal: "make my build faster" not "optimize"
112139- Include error messages when debugging
113140
114- Gordon works best when you describe what you want to achieve rather than how to
115- do it.
141+ Gordon works best when you describe what you want to achieve rather than how
142+ to do it. Gordon maintains context across a conversation, so you can follow up
143+ with clarifications or ask related questions without repeating yourself.
116144
117145### Working directory context
118146
0 commit comments