@@ -5,17 +5,27 @@ HTTP API for docker-git orchestration (projects, agents, logs/events, federation
55This is now the intended controller plane:
66- the API runs inside ` docker-git-api `
77- ` .docker-git ` state lives in the Docker volume ` docker-git-projects `
8- - the API starts an isolated Docker daemon inside the controller by default
9- - child project containers no longer depend on host bind mounts for bootstrap auth/env
10- - the host ` /var/run/docker.sock ` is not mounted into the controller or project containers
8+ - the API uses the host Docker daemon by default via ` /var/run/docker.sock `
9+ - child project containers use host-backed Docker unless an explicit
10+ ` DOCKER_GIT_PROJECT_DOCKER_HOST ` is provided
1111
1212## Runtime contract: host-Docker-backed
1313
14- ` docker-git ` is host-Docker-backed, not isolated . The controller container
15- created from this package binds the host socket
14+ ` docker-git ` is host-Docker-backed by default . The primary controller
15+ container created from this package binds the host socket
1616(` /var/run/docker.sock:/var/run/docker.sock ` , see ` docker-compose.yml ` ) and
17- uses it to spawn per-project containers. There is no Docker-in-Docker
18- runtime; the daemon is always the host's daemon.
17+ uses it to spawn per-project containers. ` DOCKER_GIT_DOCKER_RUNTIME=isolated `
18+ is an opt-in fallback for environments that explicitly require an embedded
19+ controller daemon. In isolated mode, start the controller through the host CLI
20+ or include ` docker-compose.isolated.yml ` ; that overlay removes the host socket
21+ bind and defaults project containers to the embedded daemon endpoint
22+ ` tcp://host.docker.internal:2375 ` .
23+
24+ Security note: binding ` /var/run/docker.sock ` gives the controller container
25+ root-equivalent control over the host Docker daemon, including the ability to
26+ create containers and mount host paths. This is an intended trade-off for the
27+ host-backed architecture; run the controller only in trusted environments and
28+ review the threat model before exposing the API.
1929
2030The host CLI (` packages/app ` ) also talks to that same daemon directly when
2131it bootstraps the controller. Three failure modes look identical at first
@@ -52,6 +62,14 @@ docker compose up -d --build
5262./ctl health
5363```
5464
65+ Isolated fallback:
66+
67+ ``` bash
68+ DOCKER_GIT_DOCKER_RUNTIME=isolated \
69+ docker compose -f docker-compose.yml -f docker-compose.isolated.yml up -d --build
70+ ./ctl health
71+ ```
72+
5573Default port mapping:
5674
5775- host: ` 127.0.0.1:3334 `
@@ -61,12 +79,13 @@ Optional env:
6179
6280- ` DOCKER_GIT_API_BIND_HOST ` (default: ` 127.0.0.1 ` )
6381- ` DOCKER_GIT_API_PORT ` (default: ` 3334 ` )
64- - ` DOCKER_GIT_DOCKER_RUNTIME ` (default: ` isolated ` ; starts a managed Docker daemon in ` docker-git-api ` )
82+ - ` DOCKER_GIT_DOCKER_RUNTIME ` (default: ` host ` ; set to ` isolated ` as an optional fallback to use an embedded controller daemon )
6583- ` DOCKER_GIT_CONTROLLER_DOCKER_HOST ` (default: ` unix:///var/run/docker.sock ` ; socket path inside the controller)
84+ - ` DOCKER_GIT_CONTROLLER_PRIVILEGED ` (default: ` false ` in host mode; isolated overlays default it to ` true ` for the embedded Docker daemon)
6685- ` DOCKER_GIT_DOCKERD_TCP_HOST ` (default: ` tcp://0.0.0.0:2375 ` ; reachable only inside Docker networks unless explicitly published)
6786- ` DOCKER_GIT_DOCKERD_DEFAULT_CGROUPNS_MODE ` (default: ` host ` ; keeps nested project containers compatible with cgroup v2 DinD)
68- - ` DOCKER_GIT_PROJECT_DOCKER_HOST ` (default: ` tcp://host.docker.internal:2375 ` ; lets project containers use the isolated daemon )
69- - ` DOCKER_GIT_PROJECT_SSH_BIND_HOST ` (default: ` 0.0.0.0 ` in controller mode; project SSH binds inside the isolated controller runtime )
87+ - ` DOCKER_GIT_PROJECT_DOCKER_HOST ` (default: empty in host mode; isolated mode defaults to ` tcp://host.docker.internal:2375 ` )
88+ - ` DOCKER_GIT_PROJECT_SSH_BIND_HOST ` (default: ` 0.0.0.0 ` )
7089- ` DOCKER_GIT_PROJECTS_ROOT ` (container path, default: ` /home/dev/.docker-git ` )
7190- ` DOCKER_GIT_PROJECTS_ROOT_VOLUME ` (Docker volume name for controller state, default: ` docker-git-projects ` )
7291- ` DOCKER_GIT_FEDERATION_PUBLIC_ORIGIN ` (optional public ActivityPub origin)
0 commit comments