Skip to content

Commit e285b1f

Browse files
authored
fix(api): mount host docker data for skiller (#366)
* fix(api): mount host docker data for skiller * fix(api): make bundled skiller launch reproducible * fix(api): address skiller review follow-ups * fix(api): run scoped skiller as project user * fix skiller launch review issues * add skiller process timeout
1 parent dc188e7 commit e285b1f

10 files changed

Lines changed: 468 additions & 50 deletions

File tree

docker-compose.api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
- 1.1.1.1
3636
volumes:
3737
- docker_git_projects:${DOCKER_GIT_PROJECTS_ROOT:-/home/dev/.docker-git}
38-
- docker_git_docker_data:/var/lib/docker
38+
- /var/lib/docker:/var/lib/docker
3939
- /var/run/docker.sock:/var/run/docker.sock
4040
privileged: ${DOCKER_GIT_CONTROLLER_PRIVILEGED:-false}
4141
cgroup: host

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
- 1.1.1.1
3636
volumes:
3737
- docker_git_projects:${DOCKER_GIT_PROJECTS_ROOT:-/home/dev/.docker-git}
38-
- docker_git_docker_data:/var/lib/docker
38+
- /var/lib/docker:/var/lib/docker
3939
- /var/run/docker.sock:/var/run/docker.sock
4040
privileged: ${DOCKER_GIT_CONTROLLER_PRIVILEGED:-false}
4141
cgroup: host
90.3 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"click": {
3+
"clicked": true,
4+
"text": "Projects1",
5+
"href": "#/projects"
6+
},
7+
"page": {
8+
"href": "http://127.0.0.1:45112/api/skiller/app/#/projects",
9+
"text": "Import from Git\nImport from Local\nWORKSPACE\nDashboard\nAll Skills\n0\nMarketplace\nProjects\n1\nSettings\nProjects\nAdd project\n\napp\n\n/home/dev/app\n\napp\n/home/dev/app\nImport from Git\nImport Local\nCopy from installed\nSKILLS IN THIS PROJECT\n\nNo project-scoped skills yet.\n\nNo skills here yet. Copy one you already have installed, import from Git, or browse the Marketplace — use the buttons above or below.\n\nCopy from installed\nImport from Git\nBrowse Marketplace\nSYSTEM PROMPTS\n\nEdit the prompt files that Codex, Claude Code, and Gemini read from this container.\n\nProject system prompts\n\nFiles in this repository workspace.\n\nCodex\n\nnot created\n\n/home/dev/app/AGENTS.md\n\nDelete\nSave\n\nClaude Code\n\nnot created\n\n/home/dev/app/CLAUDE.md\n\nDelete\nSave\n\nGemini\n\nnot created\n\n/home/dev/app/GEMINI.md\n\nDelete\nSave\nGlobal system prompts\n\nFiles in the selected container home.\n\nCodex\n\nnot created\n\n/tmp/docker-git-skiller/0e9c63fe5287/home/.codex/AGENTS.md\n\nDelete\nSave\n\nClaude Code\n\nnot created\n\n/tmp/docker-git-skiller/"
10+
}
11+
}
90 KB
Loading

packages/api/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,16 @@ RUN if [ "$DOCKER_GIT_CONTROLLER_BUILD_SKILLER" = "1" ]; then \
121121
rm -rf /root/.bun/install/cache node_modules; \
122122
sleep $((attempt * 2)); \
123123
done \
124+
&& electron_zip="$(find "${electron_config_cache:-/root/.cache/electron}" -name 'electron-v*-linux-*.zip' -print -quit)" \
125+
&& if [ -z "$electron_zip" ]; then echo "Electron zip not found in cache: ${electron_config_cache:-/root/.cache/electron}" >&2; exit 1; fi \
126+
&& unzip -Z1 "$electron_zip" > /tmp/electron-zip-entries \
127+
&& if grep -Eq '(^/|(^|/)\.\.($|/))' /tmp/electron-zip-entries; then echo "Unsafe paths in Electron zip: $electron_zip" >&2; exit 1; fi \
128+
&& rm -f /tmp/electron-zip-entries \
129+
&& rm -rf node_modules/electron/dist node_modules/electron/path.txt \
130+
&& mkdir -p node_modules/electron/dist \
131+
&& unzip -q "$electron_zip" -d node_modules/electron/dist \
132+
&& printf '%s' electron > node_modules/electron/path.txt \
133+
&& test -x node_modules/electron/dist/electron \
124134
&& bun run build \
125135
&& touch out/.docker-git-browser-folder-picker.patch \
126136
&& mkdir -p out/preload \

packages/api/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ This is now the intended controller plane:
1212
## Runtime contract: host-Docker-backed
1313

1414
`docker-git` is host-Docker-backed by default. The primary controller
15-
container created from this package binds the host socket
16-
(`/var/run/docker.sock:/var/run/docker.sock`, see `docker-compose.yml`) and
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`.
15+
container created from this package binds the host socket and Docker data root
16+
(`/var/run/docker.sock:/var/run/docker.sock` and
17+
`/var/lib/docker:/var/lib/docker`, see `docker-compose.yml`) and uses them to
18+
spawn per-project containers and access the Docker volume paths reported by
19+
`docker inspect`. `DOCKER_GIT_DOCKER_RUNTIME=isolated` is an opt-in fallback for
20+
environments that explicitly require an embedded controller daemon. In isolated
21+
mode, start the controller through the host CLI or include
22+
`docker-compose.isolated.yml`; that overlay removes the host socket bind, keeps
23+
Docker data inside the controller volume, and defaults project containers to the
24+
embedded daemon endpoint `tcp://host.docker.internal:2375`.
2325

2426
Security note: binding `/var/run/docker.sock` gives the controller container
2527
root-equivalent control over the host Docker daemon, including the ability to

0 commit comments

Comments
 (0)