mirror of
https://github.com/trailofbits/claude-code-devcontainer
synced 2026-06-21 14:11:48 +00:00
Fix bind mount failure when ~/.gitconfig does not exist (#24)
Docker bind mounts require the source file to exist. Users without ~/.gitconfig (fresh machines, XDG-based config, system-only config) hit a container start failure. Add initializeCommand to create an empty ~/.gitconfig on the host before the container starts. An empty gitconfig is valid and has no side effects — git treats it as having no settings. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
"PYTHONDONTWRITEBYTECODE": "1",
|
||||
"PIP_DISABLE_PIP_VERSION_CHECK": "1"
|
||||
},
|
||||
"initializeCommand": "test -f \"$HOME/.gitconfig\" || touch \"$HOME/.gitconfig\"",
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
|
||||
"workspaceFolder": "/workspace",
|
||||
"postCreateCommand": "uv run --no-project /opt/post_install.py"
|
||||
|
||||
Reference in New Issue
Block a user