Problem
When a workflow enables Docker-in-Docker (DinD) at the workflow scope (via services: dind: + DOCKER_HOST: tcp://localhost:2375), the compiled gh aw workflow fails during AWF startup with:
[INFO] Set DOCKER_API_VERSION=1.54 (server current)
Error: Port 80 is not exposed from the container
Error: Add port mapping: -p <host_port>:80
Agentic workflows that need to build or run Docker images as part of their task cannot use this pattern.
Context
Root Cause
When DOCKER_HOST is set to a remote TCP socket (DinD daemon), the AWF docker compose commands are routed to the DinD daemon instead of the local Docker socket. The DinD daemon does not have the host port bindings that AWF relies on for the Squid proxy (ports: ["3128:3128"] in the compose config). The DinD daemon interprets "expose port" as requiring a host-level port mapping that doesn't exist in the DinD network context, causing the startup failure.
The root issue is in src/docker-manager.ts: AWF unconditionally uses DOCKER_HOST from the environment when spawning docker compose commands via execa. When DOCKER_HOST points to a DinD TCP socket, the host-side filesystem bind mounts also fail because the DinD daemon cannot access the runner host's filesystem.
Proposed Solution
-
src/docker-manager.ts — getDockerComposeEnv() or similar helper: When DOCKER_HOST is set to a TCP address (DinD), spawn docker compose with DOCKER_HOST explicitly unset (using the local socket instead), so AWF always manages its own containers via the local daemon. Add a --docker-host CLI flag to allow explicit override.
-
src/cli.ts: Add a warning when DOCKER_HOST is detected in the environment, informing the user that AWF manages its own containers via the local socket, and that the DinD daemon remains available inside the agent container (agent inherits the Docker socket mount).
-
Agent container: Ensure the DinD DOCKER_HOST value is still forwarded into the agent container's environment (via env passthrough), so the agent's workload can use DinD as intended — only the AWF orchestration layer should use the local socket.
-
Docs: Add a section in docs/environment.md explaining the DinD interaction model.
Generated by Firewall Issue Dispatcher · ● 1.6M · ◷
Problem
When a workflow enables Docker-in-Docker (DinD) at the workflow scope (via
services: dind:+DOCKER_HOST: tcp://localhost:2375), the compiledgh awworkflow fails during AWF startup with:Agentic workflows that need to build or run Docker images as part of their task cannot use this pattern.
Context
Root Cause
When
DOCKER_HOSTis set to a remote TCP socket (DinD daemon), the AWFdocker composecommands are routed to the DinD daemon instead of the local Docker socket. The DinD daemon does not have the host port bindings that AWF relies on for the Squid proxy (ports: ["3128:3128"]in the compose config). The DinD daemon interprets "expose port" as requiring a host-level port mapping that doesn't exist in the DinD network context, causing the startup failure.The root issue is in
src/docker-manager.ts: AWF unconditionally usesDOCKER_HOSTfrom the environment when spawningdocker composecommands viaexeca. WhenDOCKER_HOSTpoints to a DinD TCP socket, the host-side filesystem bind mounts also fail because the DinD daemon cannot access the runner host's filesystem.Proposed Solution
src/docker-manager.ts—getDockerComposeEnv()or similar helper: WhenDOCKER_HOSTis set to a TCP address (DinD), spawndocker composewithDOCKER_HOSTexplicitly unset (using the local socket instead), so AWF always manages its own containers via the local daemon. Add a--docker-hostCLI flag to allow explicit override.src/cli.ts: Add a warning whenDOCKER_HOSTis detected in the environment, informing the user that AWF manages its own containers via the local socket, and that the DinD daemon remains available inside the agent container (agent inherits the Docker socket mount).Agent container: Ensure the DinD
DOCKER_HOSTvalue is still forwarded into the agent container's environment (via env passthrough), so the agent's workload can use DinD as intended — only the AWF orchestration layer should use the local socket.Docs: Add a section in
docs/environment.mdexplaining the DinD interaction model.