Skip to content

Commit 21f4de5

Browse files
authored
Merge branch 'docker:main' into rust-dhi
2 parents b772b34 + 91fa587 commit 21f4de5

410 files changed

Lines changed: 19223 additions & 10316 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.

.github/workflows/agent.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Agent
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
issues: write
11+
12+
jobs:
13+
run-agent:
14+
# Only run when the "agent/fix" label is added
15+
if: github.event.label.name == 'agent/fix'
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v5
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Configure Git
25+
run: |
26+
git config user.name "github-actions[bot]"
27+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Create branch
33+
run: |
34+
git checkout -b agent/issue-${{ github.event.issue.number }}
35+
36+
- name: Run agent
37+
uses: docker/cagent-action@v1.0.3
38+
timeout-minutes: 15
39+
with:
40+
cagent-version: v1.15.5
41+
agent: ./agent.yml
42+
yolo: true
43+
prompt: |
44+
Work on GitHub issue: ${{ github.event.issue.html_url }}
45+
46+
Fetch the issue, analyze what documentation changes are needed, and
47+
implement them following your standard workflow.
48+
49+
If you identify any upstream coordination issues (broken links from
50+
vendored content, missing CLI flags, etc.), document them in
51+
.upstream-issues.md as specified in your instructions.
52+
env:
53+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Check for changes
57+
id: changes
58+
run: |
59+
if [[ -n $(git status --porcelain) ]]; then
60+
echo "has_changes=true" >> $GITHUB_OUTPUT
61+
else
62+
echo "has_changes=false" >> $GITHUB_OUTPUT
63+
fi
64+
65+
- name: Commit changes
66+
if: steps.changes.outputs.has_changes == 'true'
67+
run: |
68+
git add .
69+
git commit -m "docs: address issue #${{ github.event.issue.number }}
70+
71+
This change was automatically generated by the documentation agent team
72+
in response to issue #${{ github.event.issue.number }}.
73+
74+
🤖 Generated with cagent"
75+
76+
- name: Push changes
77+
if: steps.changes.outputs.has_changes == 'true'
78+
run: |
79+
git push -u origin agent/issue-${{ github.event.issue.number }}
80+
81+
- name: Create pull request
82+
if: steps.changes.outputs.has_changes == 'true'
83+
env:
84+
GH_TOKEN: ${{ github.token }}
85+
PR_BODY: |
86+
## Summary
87+
88+
This PR addresses #${{ github.event.issue.number }}.
89+
90+
## Changes
91+
92+
The documentation agent team analyzed the issue and implemented the requested changes.
93+
94+
🤖 Generated with [cagent](https://github.com/docker/cagent)
95+
96+
Closes #${{ github.event.issue.number }}
97+
run: |
98+
# Add upstream coordination section if file exists
99+
if [[ -f .upstream-issues.md ]]; then
100+
UPSTREAM_SECTION=$(cat .upstream-issues.md)
101+
FULL_PR_BODY="${PR_BODY/Closes #/$UPSTREAM_SECTION\n\nCloses #}"
102+
else
103+
FULL_PR_BODY="$PR_BODY"
104+
fi
105+
106+
gh pr create \
107+
--title "docs: address issue #${{ github.event.issue.number }}" \
108+
--body "$FULL_PR_BODY" \
109+
--base main \
110+
--head agent/issue-${{ github.event.issue.number }}
111+
112+
- name: Comment on issue (success)
113+
if: steps.changes.outputs.has_changes == 'true'
114+
env:
115+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116+
run: |
117+
gh issue comment ${{ github.event.issue.number }} --body "✅ The agent team has created a PR to address this issue. Please review when ready."
118+
119+
- name: Comment on issue (no changes)
120+
if: steps.changes.outputs.has_changes == 'false'
121+
env:
122+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
run: |
124+
gh issue comment ${{ github.event.issue.number }} --body "ℹ️ The agent team ran but didn't make any changes. This might indicate the issue needs clarification or is already resolved."
125+
126+
- name: Comment on issue (failure)
127+
if: failure()
128+
env:
129+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130+
run: |
131+
gh issue comment ${{ github.event.issue.number }} --body "❌ The agent team encountered an error. Please check the [workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details."

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
-
101101
name: Install reviewdog
102102
if: ${{ matrix.target == 'vale' && github.event_name == 'pull_request' }}
103-
uses: reviewdog/action-setup@d8edfce3dd5e1ec6978745e801f9c50b5ef80252 # v1.4.0
103+
uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0
104104
-
105105
name: Run reviewdog for vale
106106
if: ${{ matrix.target == 'vale' && github.event_name == 'pull_request' }}

.github/workflows/deploy.yml

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -28,48 +28,28 @@ jobs:
2828
runs-on: ubuntu-24.04
2929
if: github.repository_owner == 'docker'
3030
steps:
31-
-
32-
name: Prepare
33-
run: |
34-
DOCS_AWS_REGION=us-east-1
35-
HUGO_ENV=production
36-
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
37-
DOCS_URL="https://docs.docker.com"
38-
DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001"
39-
DOCS_S3_BUCKET="prod-docs-docs.docker.com"
40-
DOCS_CLOUDFRONT_ID="E228TTN20HNU8F"
41-
DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod"
42-
DOCS_SLACK_MSG="Successfully deployed docs from the main branch. $DOCS_URL"
43-
elif [ "${{ github.ref }}" = "refs/heads/lab" ]; then
44-
HUGO_ENV=lab
45-
DOCS_URL="https://docs-labs.docker.com"
46-
DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/labs-docs-docs.docker.com-20220818202218402500000001"
47-
DOCS_S3_BUCKET="labs-docs-docs.docker.com"
48-
DOCS_CLOUDFRONT_ID="E1MYDYF65FW3HG"
49-
DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-labs"
50-
else
51-
echo >&2 "ERROR: unknown branch ${{ github.ref }}"
52-
exit 1
53-
fi
54-
SEND_SLACK_MSG="true"
55-
if [ -z "$DOCS_AWS_IAM_ROLE" ] || [ -z "$DOCS_S3_BUCKET" ] || [ -z "$DOCS_CLOUDFRONT_ID" ] || [ -z "$DOCS_SLACK_MSG" ]; then
56-
SEND_SLACK_MSG="false"
57-
fi
58-
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
59-
echo "HUGO_ENV=$HUGO_ENV" >> $GITHUB_ENV
60-
echo "DOCS_URL=$DOCS_URL" >> $GITHUB_ENV
61-
echo "DOCS_AWS_REGION=$DOCS_AWS_REGION" >> $GITHUB_ENV
62-
echo "DOCS_AWS_IAM_ROLE=$DOCS_AWS_IAM_ROLE" >> $GITHUB_ENV
63-
echo "DOCS_S3_BUCKET=$DOCS_S3_BUCKET" >> $GITHUB_ENV
64-
echo "DOCS_CLOUDFRONT_ID=$DOCS_CLOUDFRONT_ID" >> $GITHUB_ENV
65-
echo "DOCS_LAMBDA_FUNCTION_REDIRECTS=$DOCS_LAMBDA_FUNCTION_REDIRECTS" >> $GITHUB_ENV
66-
echo "DOCS_SLACK_MSG=$DOCS_SLACK_MSG" >> $GITHUB_ENV
67-
echo "SEND_SLACK_MSG=$SEND_SLACK_MSG" >> $GITHUB_ENV
6831
-
6932
name: Checkout
7033
uses: actions/checkout@v5
7134
with:
7235
fetch-depth: 0
36+
-
37+
name: Set environment variables
38+
uses: actions/github-script@v8
39+
env:
40+
INPUT_GITHUB-REF: ${{ github.ref }}
41+
with:
42+
script: |
43+
const fs = require('fs');
44+
const env = JSON.parse(fs.readFileSync('hack/releaser/env.json', 'utf8'));
45+
const ref = core.getInput('github-ref');
46+
if (!env.hasOwnProperty(ref)) {
47+
core.setFailed(`ERROR: unknown branch ${ref}`);
48+
}
49+
for (const [key, value] of Object.entries(env[ref])) {
50+
core.exportVariable(key, value);
51+
core.info(`${key}=${value}`);
52+
}
7353
-
7454
name: Set up Docker Buildx
7555
uses: docker/setup-buildx-action@v3
@@ -129,8 +109,3 @@ jobs:
129109
env:
130110
AWS_REGION: us-east-1 # cloudfront is only available in us-east-1 region
131111
AWS_MAX_ATTEMPTS: 5
132-
-
133-
name: Send Slack notification
134-
if: ${{ env.SEND_SLACK_MSG == 'true' }}
135-
run: |
136-
curl -X POST -H 'Content-type: application/json' --data '{"text":"${{ env.DOCS_SLACK_MSG }}"}' ${{ secrets.SLACK_WEBHOOK }}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: sync-cli-docs
2+
3+
on:
4+
schedule:
5+
# Run daily at 02:00 UTC
6+
- cron: '0 2 * * *'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: "(optional) Docker CLI version - defaults to docker_ce_version in hugo.yaml"
11+
required: false
12+
default: ""
13+
pull_request:
14+
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
19+
jobs:
20+
sync-cli-docs:
21+
runs-on: ubuntu-24.04
22+
steps:
23+
-
24+
name: Checkout docs repo
25+
uses: actions/checkout@v5
26+
with:
27+
fetch-depth: 0
28+
-
29+
name: Get version from hugo.yaml
30+
id: get-version
31+
run: |
32+
if [ -n "${{ inputs.version }}" ]; then
33+
VERSION="${{ inputs.version }}"
34+
else
35+
VERSION=$(grep "docker_ce_version:" hugo.yaml | awk '{print $2}' | tr -d '"')
36+
fi
37+
# TODO(vvoland): Remove this after 29.2.0 is released
38+
# VERSION=v${VERSION}
39+
VERSION=60f06cb2df3df36ddfb531c1dae8c6fa96e5f9e7
40+
41+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
42+
echo "Docker CLI version: **$VERSION**" | tee -a "$GITHUB_STEP_SUMMARY"
43+
-
44+
name: Checkout docker/cli repo
45+
uses: actions/checkout@v5
46+
with:
47+
repository: docker/cli
48+
path: cli-source
49+
ref: ${{ steps.get-version.outputs.version }}
50+
fetch-depth: 0
51+
-
52+
name: Create update branch
53+
id: create-branch
54+
run: |
55+
BRANCH_NAME="bot/sync-cli-docs-$(date +%Y%m%d-%H%M%S)"
56+
git checkout -b "$BRANCH_NAME"
57+
echo "branch_name=$BRANCH_NAME" >> "$GITHUB_OUTPUT"
58+
git config user.name "github-actions[bot]"
59+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
60+
-
61+
name: Run sync script
62+
id: sync
63+
run: |
64+
set +e
65+
./hack/sync-cli-docs.sh HEAD cli-source
66+
EXIT_CODE=$?
67+
set -e
68+
69+
if [ $EXIT_CODE -eq 0 ]; then
70+
echo "changes=true" >> "$GITHUB_OUTPUT"
71+
echo "Changes detected - syncing CLI docs" >> "$GITHUB_STEP_SUMMARY"
72+
elif [ $EXIT_CODE -eq 100 ]; then
73+
echo "changes=false" >> "$GITHUB_OUTPUT"
74+
echo "No changes to sync - CLI docs are up to date" >> "$GITHUB_STEP_SUMMARY"
75+
else
76+
echo "::error::Script failed with exit code $EXIT_CODE"
77+
exit $EXIT_CODE
78+
fi
79+
80+
-
81+
name: Show PR
82+
if: steps.sync.outputs.changes == 'true'
83+
run: |
84+
git show "${{ steps.create-branch.outputs.branch_name }}"
85+
-
86+
name: Create Pull Request
87+
if: steps.sync.outputs.changes == 'true' && github.event_name != 'pull_request'
88+
env:
89+
GH_TOKEN: ${{ github.token }}
90+
PR_BODY: |
91+
## Summary
92+
93+
Automated sync of CLI documentation from docker/cli repository.
94+
run: |
95+
git push -u origin "${{ steps.create-branch.outputs.branch_name }}"
96+
gh pr create \
97+
--title "cli: sync docs with docker/cli" \
98+
--body "$PR_BODY" \
99+
--base main \
100+
--head "${{ steps.create-branch.outputs.branch_name }}"

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ public
1010
resources
1111
static/pagefind
1212
tmp
13+
# Binary installed by cagent-action in CI
14+
cagent
15+
# cagent tmp files
16+
.cagent
17+
.upstream-issues.md
18+
.validation.log

_vale/config/vocabularies/Docker/accept.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ pgAdmin
161161
PKG
162162
plaintext
163163
plist
164+
pluggable
164165
Postgres
165166
PowerShell
166167
Python
@@ -169,6 +170,7 @@ Quickview
169170
rebalance
170171
reimplement
171172
Rekor
173+
ROCm
172174
rollback
173175
rootful
174176
runc
@@ -183,6 +185,7 @@ Solr
183185
SonarQube
184186
Splunk
185187
SQLite
188+
stargz
186189
stdin
187190
stdout
188191
subfolder
@@ -211,6 +214,7 @@ Visual Studio Code
211214
VMware
212215
vpnkit
213216
vSphere
217+
Vulkan
214218
Vue
215219
Wasm
216220
Wasmtime
@@ -288,4 +292,6 @@ Zsh
288292
[Vv]irtiofs
289293
[Vv]irtualize
290294
[Ww]alkthrough
291-
295+
[Tt]oolsets?
296+
[Rr]erank(ing|ed)?
297+
[Ee]vals?

_vendor/github.com/docker/cli/docs/reference/dockerd.md

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

0 commit comments

Comments
 (0)