You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/environment.md
+60Lines changed: 60 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,66 @@ When enabled, the library logs:
186
186
187
187
**Note:** Debug output goes to stderr and does not interfere with command stdout. See `containers/agent/one-shot-token/README.md` for complete documentation.
When a GitHub Actions workflow enables Docker-in-Docker (DinD) at the **workflow scope** — for example by starting a `docker:dind` service container and setting `DOCKER_HOST: tcp://localhost:2375` in the runner's environment — AWF handles the conflict automatically.
192
+
193
+
### What happens
194
+
195
+
AWF's container orchestration (Squid proxy, agent, iptables-init) must run on the **local** Docker daemon so that:
196
+
- bind mounts from the runner host filesystem work correctly,
197
+
- AWF's fixed subnet (`172.30.0.0/24`) and iptables DNAT rules are created in the right network namespace, and
198
+
- port binding expectations between containers are satisfied.
199
+
200
+
When `DOCKER_HOST` is set to a TCP address, AWF:
201
+
202
+
1.**Emits a warning** (not an error) informing you that the local socket will be used for AWF's own containers.
203
+
2.**Clears `DOCKER_HOST`** for all `docker` / `docker compose` calls it makes internally, so they target the local daemon.
204
+
3.**Forwards the original `DOCKER_HOST`** into the agent container's environment, so Docker commands run *by the agent* still reach the DinD daemon.
205
+
206
+
### Example workflow structure
207
+
208
+
```yaml
209
+
jobs:
210
+
build:
211
+
runs-on: ubuntu-latest
212
+
services:
213
+
dind:
214
+
image: docker:dind
215
+
options: --privileged
216
+
ports:
217
+
- 2375:2375
218
+
env:
219
+
DOCKER_HOST: tcp://localhost:2375
220
+
steps:
221
+
- uses: actions/checkout@v4
222
+
- name: Run agent with AWF
223
+
run: |
224
+
# AWF warns about DOCKER_HOST but proceeds with local socket for its own containers.
225
+
# The agent can run `docker build` / `docker run` and they will reach the DinD daemon
226
+
# via the forwarded DOCKER_HOST inside the container.
This overrides the socket used for AWF's own operations without affecting the agent's `DOCKER_HOST`.
241
+
242
+
### Limitation
243
+
244
+
The DinD TCP address (e.g., `tcp://localhost:2375`) typically refers to the runner host's localhost interface. From *inside* the agent container, `localhost` resolves to the container's own loopback interface, not the host's. To make docker commands inside the agent reach the DinD daemon you need one of:
245
+
246
+
- **`--enable-host-access`** — allows the agent to reach `host.docker.internal` and set `DOCKER_HOST=tcp://host.docker.internal:2375` inside the agent.
247
+
- **`--enable-dind`** — mounts the local Docker socket (`/var/run/docker.sock`) directly into the agent container (only works when using the local daemon, not a remote DinD TCP socket).
248
+
189
249
## Troubleshooting
190
250
191
251
**Variable not accessible:** Use `sudo -E` or pass explicitly with `--env VAR="$VAR"`
0 commit comments