Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/css/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
}
}
.button {
@apply mt-1 inline-block rounded-sm bg-blue-500 p-1 px-3 text-blue-50 text-white hover:bg-blue-600 dark:bg-blue-500 hover:dark:bg-blue-400;
@apply my-2 mr-2 inline-block rounded-sm bg-blue-500 p-1 px-3 text-blue-50 text-white hover:bg-blue-600 dark:bg-blue-500 hover:dark:bg-blue-400;
}

.summary-bar {
Expand Down
28 changes: 28 additions & 0 deletions content/includes/gordondhi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
1. Ensure Gordon is [enabled](/manuals/ai/gordon.md#enable-ask-gordon).
1. In Gordon's Toolbox, ensure Gordon's [Developer MCP toolkit is enabled](/manuals/ai/gordon/mcp/built-in-tools.md#configuration).
1. In the terminal, navigate to the directory containing your Dockerfile.
1. Start a conversation with Gordon:
```bash
docker ai
```
1. Type:
```console
"Migrate my dockerfile to DHI"
```
1. Follow the conversation with Gordon. Gordon will edit your Dockerfile, so when
it requests access to the filesystem and more, type `yes` to allow Gordon to proceed.

> [!NOTE]
> To learn more about Gordon's data retention and the data it
> can access, see [Gordon](/manuals/ai/gordon.md#what-data-does-gordon-access).

When the migration is complete, you see a success message:

```text
The migration to Docker Hardened Images (DHI) is complete. The updated Dockerfile
successfully builds the image, and no vulnerabilities were detected in the final image.
The functionality and optimizations of the original Dockerfile have been preserved.
```

> [!IMPORTANT]
> As with any AI tool, you must verify Gordon's edits and test your image.
5 changes: 5 additions & 0 deletions content/manuals/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ params:
description: Run containers programmatically in your preferred programming language.
icon: /icons/Testcontainers.svg
link: /testcontainers/
- title: MCP Gateway
description: Manage and secure your AI tools with a single gateway.
icon: /icons/toolkit.svg
link: /ai/mcp-gateway/

ai:
- title: Ask Gordon
description: Streamline your workflow and get the most out of the Docker ecosystem with your personal AI assistant.
Expand Down
22 changes: 18 additions & 4 deletions content/manuals/ai/gordon/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ of the Docker ecosystem.

## Key features

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

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

It understands your local environment, including source code, Dockerfiles, and
images, to provide personalized and actionable guidance.
Expand Down Expand Up @@ -104,9 +105,10 @@ If you have concerns about data collection or usage, you can

## Using Ask Gordon

The primary interfaces to Docker's AI capabilities are through the **Ask
Gordon** view in Docker Desktop, or if you prefer to use the CLI: the `docker
ai` CLI command.
You can access Gordon:

- In Docker Desktop, in the **Ask Gordon** view.
- Via the Docker CLI, with the `docker ai` CLI command.

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

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

Expand Down Expand Up @@ -197,6 +200,17 @@ across several dimensions:
- Portability
- Resource efficiency

### Migrate a Dockerfile to DHI

Migrating your Dockerfile to use [Docker Hardened Images](/manuals/dhi/_index.md) helps you build
more secure, minimal, and production-ready containers. DHIs are designed to
reduce vulnerabilities, enforce best practices, and simplify compliance, making
them a strong foundation for secure software supply chains.

To request Gordon's help for the migration:

{{% include "gordondhi.md" %}}

## Disable Ask Gordon

### For individual users
Expand Down
230 changes: 230 additions & 0 deletions content/manuals/ai/mcp-catalog-and-toolkit/hub-mcp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
---
title: Docker Hub MCP server
description: Use the MCP Toolkit to set up MCP servers and MCP clients.
keywords: Docker Hub MCP Server, Hub MCP server, Hub MCP
---

The Docker Hub MCP Server is a Model Context Protocol (MCP) server that interfaces with Docker Hub APIs to make rich image metadata accessible to LLMs, enabling intelligent content discovery and repository management. Developers building with containers, especially in AI and LLM-powered workflows, often face inadequate context across the vast landscape of Docker Hub images. As a result, LLMs struggle to recommend the right images, and developers lose time manually searching instead of building.

## Key features

- Advanced LLM context: Our MCP Server provides LLMs with detailed, structured context for Docker Hub images, enabling smarter, more relevant recommendations for developers, whether they're choosing a base image or automating CI/CD workflows.
- Natural language image discovery: Developers can find the right container image using natural language, no need to remember tags or repository names. Just describe what you need, and Docker Hub will return images that match your intent.
- Simplified repository management: Hub MCP Server enables agents to manage repositories through natural language fetching image details, viewing stats, searching content, and performing key operations quickly and easily.

## Install Docker Hub MCP server

1. From the **MCP Toolkit** menu, select the **Catalog** tab and search for **Docker Hub** and select the plus icon to add the Docker Hub MCP server.
1. In the server's **Configuration** tab, insert your Docker Hub username and personal access token (PAT).
1. In the **Clients** tab in MCP Toolkit, ensure Gordon is connected.
1. From the **Ask Gordon** menu, you can now send requests related to your
Docker Hub account, in accordance to the tools provided by the Docker Hub MCP server. To test it, ask Gordon:

```text
What repositories are in my namespace?
```

> [!TIP]
> By default, the Gordon [client](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md#install-an-mcp-client) is enabled,
> which means Gordon can automatically interact with your MCP servers.

## Using other clients

If want to integrate the Docker Hub MCP Server into your own development environment, you can find the source code and installation instructions on our [GitHub repository](https://github.com/docker/hub-mcp).

## Use Claude Desktop as a client

1. Add the Docker Hub MCP Server configuration to your `claude_desktop_config.json`:

### For public repositories only

- `/FULL/PATH/TO/YOUR/docker-hub-mcp-server` - The complete path to where you cloned this repository
```json
{
"mcpServers": {
"docker-hub": {
"command": "node",
"args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio"]
}
}
}
```

### For authenticated access

Replace the following values:
- `YOUR_DOCKER_HUB_USERNAME` - Your Docker Hub username
- `YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN` - Your Docker Hub Personal Access Token
- `/FULL/PATH/TO/YOUR/docker-hub-mcp-server` - The complete path to where you cloned this

```json
{
"mcpServers": {
"docker-hub": {
"command": "node",
"args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio", "--username=YOUR_DOCKER_HUB_USERNAME"],
"env": {
"HUB_PAT_TOKEN": "YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN"
}
}
}
}
```
1. Save the configuration file and completely restart Claude Desktop for the changes to take effect.

## Usage with VS Code

1. Add the Docker Hub MCP Server configuration to your User Settings (JSON) file in VS Code. You can do this by opening the `Command Palette` and typing `Preferences: Open User Settings (JSON)`.

### For public repositories only

- `/FULL/PATH/TO/YOUR/docker-hub-mcp-server` - The complete path to where you cloned this repository
```json
{
"mcpServers": {
"docker-hub": {
"command": "node",
"args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio"]
}
}
}
```

### For authenticated access

Replace the following values:
- `YOUR_DOCKER_HUB_USERNAME` - Your Docker Hub username
- `YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN` - Your Docker Hub Personal Access Token
- `/FULL/PATH/TO/YOUR/docker-hub-mcp-server` - The complete path to where you cloned this

```json
{
"mcpServers": {
"docker-hub": {
"command": "node",
"args": ["/FULL/PATH/TO/YOUR/docker-hub-mcp-server/dist/index.js", "--transport=stdio"],
"env": {
"HUB_USERNAME": "YOUR_DOCKER_HUB_USERNAME",
"HUB_PAT_TOKEN": "YOUR_DOCKER_HUB_PERSONAL_ACCESS_TOKEN"
}
}
}
}
```
1. Open the `Command Palette` and type `MCP: List Servers`.
1. Select `docker-hub` and select `Start Server`.

## Usage examples

This section provides task-oriented examples for common operations with Docker Hub
tools.


### Finding images

```console
# Search for official images
$ docker ai "Search for official nginx images on Docker Hub"

# Search for lightweight images to reduce deployment size and improve performance
$ docker ai "Search for minimal Node.js images with small footprint"

# Get the most recent tag of a base image
$ docker ai "Show me the latest tag details for go"

# Find a production-ready database with enterprise features and reliability
$ docker ai "Search for production ready database images"

# Compare Ubuntu versions to choose the right one for my project
$ docker ai "Help me find the right Ubuntu version for my project"
```

### Repository management

```console
# Create a repository
$ docker ai "Create a repository in my namespace"

# List all repositories in my namespace
$ docker ai "List all repositories in my namespace"

# Find the largest repository in my namespace
$ docker ai "Which of my repositories takes up the most space?"

# Find repositories that haven't been updated recently
$ docker ai "Which of my repositories haven't had any pushes in the last 60 days?"

# Find which repositories are currently active and being used
$ docker ai "Show me my most recently updated repositories"

# Get details about a repository
$ docker ai "Show me information about my '<repository-name>' repository"
```

### Pull/push images

```console
# Pull latest PostgreSQL version
$ docker ai "Pull the latest postgres image"

# Push image to your Docker Hub repository
$ docker ai "Push my <image-name> to my <repository-name> repository"
```

### Tag management

```console
# List all tags for a repository
$ $ docker ai "Show me all tags for my '<repository-name>' repository"

# Find the most recently pushed tag
$ docker ai "What's the most recent tag pushed to my '<repository-name>' repository?"

# List tags with architecture filtering
$ docker ai "List tags for in the '<repository-name>' repository that support amd64 architecture"

# Get detailed information about a specific tag
$ docker ai "Show me details about the '<tag-name>' tag in the '<repository-name>' repository"

# Check if a specific tag exists
$ docker ai "Check if version 'v1.2.0' exists for my 'my-web-app' repository"
```

### Docker Hardened Images

```console
# List available hardened images
$ docker ai "What is the most secure image I can use to run a node.js application?"

# Convert Dockerfile to use a hardened image
$ docker ai "Can you help me update my Dockerfile to use a docker hardened image instead of the current one"
```
> [!NOTE]
> To access Docker Hardened Images, a subscription is required. If you're interested in using Docker Hardened Images, visit [Docker Hardened Images](https://www.docker.com/products/hardened-images/).


## Reference

This section provides a comprehensive listing of the tools you can find
in the Docker Hub MCP Server.

### Docker Hub MCP server tools

Tools to interact with your Docker repositories and discover content on Docker Hub.

| Name | Description |
|------|-------------|
| `check-repository` | Check repository |
| `check-repository-tag` | Check repository tag |
| `check-repository-tags` | Check repository tags |
| `create-repository` | Creates a new repository |
| `docker-hardened-images` | Lists available [Docker Hardened Images](https://www.docker.com/products/hardened-images/) in specified namespace |
| `get-namespaces` | Get organizations/namespaces for a user |
| `get-repository-dockerfile` | Gets dockerfile for repository |
| `get-repository-info` | Gets repository info |
| `list-repositories-by-namespace` | Lists repositories under namespace |
| `list-repository-tags` | List repository tags |
| `read-repository-tag` | Read repository tag |
| `search` | Search content on Docker Hub |
| `set-repository-dockerfile` | Sets Dockerfile for repository |
| `update-repository-info` | Updates repository info |
Loading
Loading