Unexpected workspaceFolder mount behavior when dev container is opened before Git initialization
@v-Kaniska244 がすでに取り組んでいます。
2025年8月6日 から。
評価
この issue はまだ評価されていません。
説明
I've encountered a strange and hard-to-debug behavior when using multiple devcontainer.json files in a monorepo setup.
Steps to Reproduce
- Create a new directory (not yet initialized as a Git repository).
- Add a
.devcontainerfolder in the root with multipledevcontainer.jsonfiles, each specifying a differentworkspaceFolderto scope the dev container to a project in the monorepo. - Open one of the devcontainers in VS Code before initializing the root directory as a Git repository.
- Observe that the workspace folder is mounted incorrectly — the parent folder is mounted instead of the expected project directory.
- Now run
git initin the root of the repo. - Reopen the devcontainer. Everything now works as expected, with the
workspaceFoldercorrectly mounted.
🧠 Expected Behavior
The specified workspaceFolder should be mounted correctly, even if the root directory hasn't been initialized as a Git repository.
😕 Actual Behavior
Before Git initialization, the mount behavior is incorrect — it mounts the parent directory instead of the specified workspaceFolder. This is confusing and difficult to diagnose.
💥 Impact
This behavior makes it hard to use dev containers in new projects or automation scripts that generate dev containers before initializing Git. It also leads to unexpected mount paths, which can break tooling, scripts, or assumptions about paths inside the container.
✅ Suggested Fix
The logic determining the workspaceFolder mount should not depend on whether the folder has been initialized as a Git repository. If Git initialization is required for some internal behavior, it should at least produce a warning or fallback gracefully.
Let me know if you'd like logs or a minimal repro repo — happy to provide more detail if needed.
- 主要言語
- TypeScript
- スター
- 3k
- フォーク
- 461
- 平均マージ
- 18分
- マージ済み PR(30日)
- 5
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
devcontainers/cli のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
devcontainers/cli#1203 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
devcontainers/cli#1178 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
devcontainers/cli#1308 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
devcontainers/cli#1307 · コメント 1 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
devcontainers/cli#1305 ·
devcontainers/cli の issue をすべて見る
似ている issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Crush オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
ElementsProject/cln-application#167 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Quantco/pnpm-licenses#17 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100