Skip to content

Commit 27fe879

Browse files
Update devcontainer guide
1 parent 77d9c76 commit 27fe879

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
// start). Use it for one-time setup: installing dependencies, configuring
9999
// git hooks, seeding databases, etc.
100100
// Chain commands with && so the step fails fast if anything goes wrong.
101-
"postCreateCommand": "git config core.hooksPath .githooks",
101+
"postCreateCommand": "cp -rn /tmp/host-config/. ~/.config/ && git config core.hooksPath .githooks",
102102

103103
// postStartCommand runs on every container start (including resume).
104104
// Keep it fast. Good for starting background services or printing a welcome
@@ -137,12 +137,10 @@
137137
// enable it in your personal ~/.gitconfig if you want signed commits).
138138
"source=${localEnv:HOME}/.gnupg,target=/home/node/.gnupg,type=bind,consistency=cached,readonly",
139139

140-
// XDG config directory - shares config for all tools (opencode, gh, etc.)
141-
// so you don't need to re-authenticate or reconfigure on every rebuild.
142-
// Tradeoff: the container can read all your tool configs including tokens.
143-
// Acceptable for a trusted personal dev container; use per-tool mounts if
144-
// you prefer tighter isolation (e.g. ~/.config/opencode, ~/.config/gh).
145-
"source=${localEnv:HOME}/.config,target=/home/node/.config,type=bind,consistency=cached"
140+
// XDG config directory mounted to a staging path. postCreateCommand copies
141+
// it to ~/.config so the container gets a snapshot at creation time rather
142+
// than a live link - changes inside the container don't affect the host.
143+
"source=${localEnv:HOME}/.config,target=/tmp/host-config,type=bind,consistency=cached,readonly"
146144

147145
// Named volume for the pnpm content-addressable store. Sharing a store
148146
// across rebuilds avoids re-downloading packages. Uncomment if your

0 commit comments

Comments
 (0)