Skip to content

Commit d55fcce

Browse files
authored
docker-agent: single-source docs via Hugo module mount (#25480)
Single-sources the Docker Agent documentation from the product repo via a Hugo module mount, joining the pattern used by CLI, Buildx, Compose, BuildKit, Model Runner, and the Moby API. Closes the docs.docker.com side of docker/docker-agent#3371. ## Context The pages under `content/manuals/ai/docker-agent/` were hand-authored duplicates of the product repo docs and drifted on every upstream change. The source docs were converted to portable Hugo-clean Markdown and prepared for mounting in docker/docker-agent#3413 and docker/docker-agent#3414, released in docker-agent v1.96.0. ## What changed | Change | Detail | |---|---| | `go.mod` | `github.com/docker/docker-agent v1.96.0` added to `require` and `tool` | | `hugo.yaml` | `module.imports` mounts the eight docs sections and `demo.gif` onto `content/manuals/ai/docker-agent/` | | Content | The 16 hand-authored pages are removed; `_index.md` stays hand-authored (landing page), with links rewritten to the mounted pages | | `_vendor/` | 99 vendored files from the module | | `.github/workflows/sync-docker-agent-docs.yml` | Daily poll that vendors the latest docker-agent release and opens a bot PR, modeled on `sync-cli-docs.yml` | ## URL preservation Every removed page keeps its URL: the mounted pages carry `aliases` front matter (added upstream in docker/docker-agent#3414), and `_index.md` keeps aliases for the removed section indexes (`integrations/`, `reference/`, `reference/examples/`). | Old URL | Redirects to | |---|---| | `/ai/docker-agent/tutorial/` | `.../getting-started/quickstart/` | | `/ai/docker-agent/best-practices/` | `.../guides/tips/` | | `/ai/docker-agent/evals/` | `.../features/evaluation/` | | `/ai/docker-agent/local-models/` | `.../providers/local/` | | `/ai/docker-agent/model-providers/` | `.../providers/overview/` | | `/ai/docker-agent/rag/` | `.../tools/rag/` | | `/ai/docker-agent/sharing-agents/` | `.../concepts/distribution/` | | `/ai/docker-agent/integrations/{a2a,acp,mcp}/` | `.../features/a2a/`, `.../features/acp/`, `.../tools/mcp/` | | `/ai/docker-agent/reference/{cli,config,toolsets}/` | `.../features/cli/`, `.../configuration/overview/`, `.../configuration/tools/` | | `/ai/docker-agent/integrations/`, `/ai/docker-agent/reference/`, `/ai/docker-agent/reference/examples/` | `/ai/docker-agent/` | ## Mount scope All eight sections are mounted rather than a core subset: `refLinksErrorLevel: ERROR` makes partial mounts fail the build for any relative link into an unmounted page, and the link closure from the core sections already pulls in 68 of the 90 pages. Mounting everything keeps the build link-safe and removes all drift. ## Keeping the pin fresh On each docker-agent release, `sync-docker-agent-docs.yml` (daily poll, mirrors `sync-cli-docs.yml`) compares the latest release tag against the pinned version and opens a bot PR with the re-vendored module. docker/docker-agent also runs `validate-upstream.yml` on every docs PR, so upstream changes that would break this site fail CI before they merge (two source-side issues were caught exactly this way while preparing this change). ## Validation `docker buildx bake validate` passes on this branch: | Target | Result | |---|---| | test (Hugo build + htmltest) | pass (3196 pages, 1515 aliases, 3110 documents tested) | | lint | pass | | unused-media | pass | | test-go-redirects | pass | | validate-vendor | pass | | dockerfile-lint | pass | `actionlint` passes on the new workflow.
1 parent 915f25a commit d55fcce

122 files changed

Lines changed: 17461 additions & 4166 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: sync-docker-agent-docs
2+
3+
on:
4+
schedule:
5+
# Run daily at 02:30 UTC, offset from sync-cli-docs
6+
- cron: '30 2 * * *'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: "(optional) docker-agent version - defaults to the latest release tag"
11+
required: false
12+
default: ""
13+
pull_request:
14+
paths:
15+
- '.github/workflows/sync-docker-agent-docs.yml'
16+
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
21+
env:
22+
BRANCH_NAME: "bot/sync-docker-agent-docs"
23+
MODULE_NAME: "github.com/docker/docker-agent"
24+
25+
jobs:
26+
sync-docker-agent-docs:
27+
runs-on: ubuntu-24.04
28+
steps:
29+
-
30+
name: Checkout docs repo
31+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
32+
with:
33+
fetch-depth: 0
34+
-
35+
name: Get target version
36+
id: get-version
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
run: |
40+
if [ -n "${{ inputs.version }}" ]; then
41+
VERSION="${{ inputs.version }}"
42+
else
43+
VERSION=$(gh release view --repo docker/docker-agent --json tagName --jq .tagName)
44+
fi
45+
CURRENT=$(go list -m -f '{{ .Version }}' "$MODULE_NAME" || true)
46+
47+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
48+
echo "current=$CURRENT" >> "$GITHUB_OUTPUT"
49+
echo "docker-agent version: **$VERSION** (currently pinned: **$CURRENT**)" | tee -a "$GITHUB_STEP_SUMMARY"
50+
-
51+
name: Set up Docker Buildx
52+
if: steps.get-version.outputs.version != steps.get-version.outputs.current
53+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
54+
-
55+
# go mod edit sets the version before plain make vendor: passing
56+
# VENDOR_MODULE would run hugo mod get, which records docker-agent's
57+
# full transitive graph as indirect requires in go.mod.
58+
name: Update vendor
59+
if: steps.get-version.outputs.version != steps.get-version.outputs.current
60+
run: |
61+
go mod edit -require "${MODULE_NAME}@${{ steps.get-version.outputs.version }}"
62+
make vendor
63+
-
64+
name: Detect changes
65+
id: changes
66+
if: steps.get-version.outputs.version != steps.get-version.outputs.current
67+
run: |
68+
if [ -n "$(git status --porcelain)" ]; then
69+
echo "changes=true" >> "$GITHUB_OUTPUT"
70+
echo "Changes detected - syncing Docker Agent docs" >> "$GITHUB_STEP_SUMMARY"
71+
else
72+
echo "changes=false" >> "$GITHUB_OUTPUT"
73+
echo "No changes to sync - Docker Agent docs are up to date" >> "$GITHUB_STEP_SUMMARY"
74+
fi
75+
-
76+
name: Commit changes
77+
if: steps.changes.outputs.changes == 'true'
78+
env:
79+
BRANCH_NAME: ${{ env.BRANCH_NAME }}
80+
VERSION: ${{ steps.get-version.outputs.version }}
81+
run: |
82+
git checkout -b "$BRANCH_NAME"
83+
git config user.name "github-actions[bot]"
84+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
85+
git add -A
86+
git commit -m "docker-agent: sync docs with docker-agent $VERSION"
87+
-
88+
name: Create or update Pull Request
89+
if: steps.changes.outputs.changes == 'true' && github.event_name != 'pull_request'
90+
env:
91+
GH_TOKEN: ${{ github.token }}
92+
BRANCH_NAME: ${{ env.BRANCH_NAME }}
93+
PR_TITLE: "docker-agent: sync docs with docker-agent ${{ steps.get-version.outputs.version }}"
94+
PR_BODY: |
95+
## Summary
96+
97+
Automated sync of Docker Agent documentation from the docker/docker-agent repository.
98+
99+
**docker-agent version:** ${{ steps.get-version.outputs.version }}
100+
101+
---
102+
103+
> [!IMPORTANT]
104+
> **Reviewer:** Please close and reopen this PR to trigger CI checks.
105+
> See: https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#triggering-a-workflow-from-a-workflow
106+
run: |
107+
# Check for existing open PR from this branch
108+
EXISTING_PR=$(gh pr list --state open --head "$BRANCH_NAME" --json url --jq ".[0].url // empty")
109+
110+
if [ -n "$EXISTING_PR" ]; then
111+
echo "Updating existing PR: $EXISTING_PR" >> "$GITHUB_STEP_SUMMARY"
112+
git push -u origin "$BRANCH_NAME" --force
113+
gh pr edit "$EXISTING_PR" --title "$PR_TITLE" --body "$PR_BODY"
114+
else
115+
# Check if a closed PR with the same title already exists
116+
CLOSED_PR=$(gh pr list --state closed --search "$PR_TITLE in:title" --json url --jq ".[0].url // empty")
117+
if [ -n "$CLOSED_PR" ]; then
118+
echo "A closed PR already exists for this version: $CLOSED_PR" >> "$GITHUB_STEP_SUMMARY"
119+
echo "Skipping PR creation."
120+
exit 0
121+
fi
122+
123+
echo "Creating new PR" >> "$GITHUB_STEP_SUMMARY"
124+
git push -u origin "$BRANCH_NAME"
125+
gh pr create \
126+
--title "$PR_TITLE" \
127+
--body "$PR_BODY" \
128+
--base main \
129+
--head "$BRANCH_NAME"
130+
fi

_vendor/github.com/docker/docker-agent/docs/community/_index.md

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_vendor/github.com/docker/docker-agent/docs/community/contributing/index.md

Lines changed: 130 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_vendor/github.com/docker/docker-agent/docs/community/opentelemetry/index.md

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)