Unexpected workspaceFolder mount behavior when dev container is opened before Git initialization
Maintainer thường phản hồi trong vòng 1 ngày
@v-Kaniska244 đang làm issue này rồi.
Từ ngày 6/8/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 3k
- Fork
- 463
- Merge trung bình
- 13 giờ 28 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của devcontainers/cli
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
devcontainers/cli#1203 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
devcontainers/cli#1178 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
devcontainers/cli#1317 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
devcontainers/cli#1308 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
build rejects valid tag@digest image references during registry inspectionCó thể đã có người làm @v-Kaniska244 đã nhận 7 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
devcontainers/cli#1307 · 2 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của devcontainers/cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
external-issue to-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
diegosouzapw/OmniRoute#15401 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Sign the pledgeĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
input-output-hk/devx-updates#163 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
code-yeongyu/oh-my-openagent#9454 ·
Maintainer thường phản hồi trong vòng 1 ngày