-
Notifications
You must be signed in to change notification settings - Fork 17
fix: handle workflow-scope DinD (DOCKER_HOST=tcp://) without failing AWF startup #1943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
d82b045
fc457b1
f5c2cb9
8f748ec
72ff1cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,6 +16,7 @@ import { | |||||||||||||||
| preserveIptablesAudit, | ||||||||||||||||
| fastKillAgentContainer, | ||||||||||||||||
| collectDiagnosticLogs, | ||||||||||||||||
| setAwfDockerHost, | ||||||||||||||||
| } from './docker-manager'; | ||||||||||||||||
| import { | ||||||||||||||||
| ensureFirewallNetwork, | ||||||||||||||||
|
|
@@ -1370,6 +1371,12 @@ program | |||||||||||||||
| 'Use local images without pulling from registry (requires pre-downloaded images)', | ||||||||||||||||
| false | ||||||||||||||||
| ) | ||||||||||||||||
| .option( | ||||||||||||||||
| '--docker-host <socket>', | ||||||||||||||||
| 'Docker socket for AWF\'s own containers (default: auto-detect from DOCKER_HOST env).\n' + | ||||||||||||||||
| ' Use when Docker is at a non-standard path.\n' + | ||||||||||||||||
| ' Example: unix:///run/user/1000/docker.sock' | ||||||||||||||||
| ) | ||||||||||||||||
|
Comment on lines
+1374
to
+1379
|
||||||||||||||||
|
|
||||||||||||||||
| // -- Container Configuration -- | ||||||||||||||||
| .option( | ||||||||||||||||
|
|
@@ -1602,12 +1609,15 @@ program | |||||||||||||||
|
|
||||||||||||||||
| logger.setLevel(logLevel); | ||||||||||||||||
|
|
||||||||||||||||
| // Fail fast when DOCKER_HOST points at an external daemon (e.g. workflow-scope DinD). | ||||||||||||||||
| // AWF's network isolation depends on direct access to the local Docker socket. | ||||||||||||||||
| // When DOCKER_HOST points at an external TCP daemon (e.g. workflow-scope DinD), | ||||||||||||||||
| // AWF redirects its own docker calls to the local socket automatically. | ||||||||||||||||
| // The original DOCKER_HOST value is forwarded into the agent container so the | ||||||||||||||||
| // agent workload can still reach the DinD daemon. | ||||||||||||||||
| const dockerHostCheck = checkDockerHost(); | ||||||||||||||||
| if (!dockerHostCheck.valid) { | ||||||||||||||||
|
||||||||||||||||
| if (!dockerHostCheck.valid) { | |
| if (!dockerHostCheck.valid) { | |
| // Apply the AWF-local docker host at the process level before any later | |
| // workflow step shells out to `docker`, so inherited env targets the local daemon. | |
| setAwfDockerHost(); |
Copilot
AI
Apr 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dockerHostCheck.error currently comes from checkDockerHost() and is still worded as a fatal incompatibility (“will be rejected…incompatible…see docs/usage.md”). Since this PR now proceeds with a warning and auto-redirects AWF’s docker calls, the message is misleading and points users at the wrong doc section. Update checkDockerHost()’s error text (or stop reusing it verbatim) so the warning accurately describes the new behavior and references the new documentation location.
| logger.warn(`⚠️ ${dockerHostCheck.error}`); | |
| logger.warn(' AWF will use the local Docker socket for its own containers.'); | |
| logger.warn(' The original DOCKER_HOST is forwarded into the agent container.'); | |
| logger.warn('⚠️ External DOCKER_HOST detected. AWF will continue by redirecting its own Docker calls to the local socket.'); | |
| logger.warn(' AWF will use the local Docker socket for its own containers.'); | |
| logger.warn(' The original DOCKER_HOST is forwarded into the agent container.'); | |
| logger.warn(' See the Docker host handling documentation for details.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two consecutive blank lines before the Troubleshooting section header, which creates an unintended extra vertical gap in the rendered markdown. Remove the extra blank line(s) to keep formatting consistent with the rest of the document.