Gordon is Docker’s official built-in AI agent.
Instead of being a generic AI assistant (like ChatGPT or Claude) where you have to manually copy and paste error logs, Gordon is purpose-built to understand your actual containerized environment. It is integrated directly into Docker Desktop and the Docker CLI.
Here is a quick overview of what Gordon does and how to use it:
1. What Makes Gordon Different?
Most AI assistants guess based on what you paste. Gordon has direct, secure access to your system (with your approval) to check the real state of your machine:
- Real Context: It can read your running containers, inspect logs, look at your
docker-compose.ymlfiles, and analyze your local project directories. - Action-Oriented: If a container crashes with a vague exit code, Gordon doesn’t just explain what the code means; it can look at the logs, pinpoint the issue, rewrite the Dockerfile, and offer a button for you to approve the fix.
- Approval First: Gordon will never execute a command, modify a file, or stop a container without showing you the exact command first and waiting for your permission.
2. Main Capabilities
- Debugging: “My container exited with code 137, why?” Gordon will check your local memory limits, see if it was an Out-Of-Memory (OOM) error, and propose a fix.
- Containerization: “Make this Node.js app run in Docker.” Gordon will scan your directory, detect dependencies, and write optimized multi-stage Dockerfiles.
- Optimization & Security: It can review your active Docker files and recommend ways to reduce image sizes or implement security health checks.
3. How to Use It
- In Docker Desktop: You will see the Gordon icon in the left sidebar. You can open it, select your project folder, and start chatting.
- In the Terminal: You can interact with it directly by running:Bash
docker aiThis opens an interactive terminal assistant that lets you ask questions like “Why is my container unhealthy?” or “Clean up my unused volumes”, giving you commands you can hityto approve and execute immediately.