Commit 67f9ad8
committed
Make dev container bind mount work from git worktrees
The dev container's docker-compose.yml mounted `../..` (the directory two
levels above .devcontainer/) as `/workspaces`, relying on the repository
being checked out into a directory literally named `oracle-enhanced` so
that `workspaceFolder: /workspaces/oracle-enhanced` resolves.
When the dev container is opened from a git worktree (e.g.
`<repo>/.worktrees/<branch>/`), `../..` resolves to `.worktrees/` instead
of a parent containing `oracle-enhanced/`. Docker then auto-creates an
empty `/workspaces/oracle-enhanced` mount target on the host, so
`postCreateCommand: bash .devcontainer/postCreateCommand.sh` fails with
"No such file or directory".
Mount the directory containing .devcontainer/ directly as
`/workspaces/oracle-enhanced` so it does not depend on the host
directory's name. This works from both the main checkout and any
worktree.1 parent 8849c0b commit 67f9ad8
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments