Parser failure on "localEnv:" in devcontainer-feature.json
Maintainer thường phản hồi trong vòng 5 ngày
@v-Kaniska244 đang làm issue này rồi.
Từ ngày 5/8/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
When trying to inject a host environment variable into the container like this (in devcontainer-feature.json)
"containerEnv": {
"MY_API_KEY": "${localEnv:MY_API_KEY}"
}
the following error is returned:
UndefinedVar: Usage of undefined variable '$localEnv' (line 23)
Dockerfile.extended:23
--------------------
21 | echo "_REMOTE_USER_HOME=$( (command -v getent >/dev/null 2>&1 && getent passwd 'vscode' || grep -E '^vscode|^[^:]*:[^:]*:vscode:' /etc/passwd || true) | cut -d: -f6)" >> /tmp/dev-container-features/devcontainer-features.builtin.env
22 |
23 | >>> ENV MY_API_KEY="${localEnv:MY_API_KEY}"
24 | RUN --mount=type=bind,from=dev_containers_feature_content_source,source=opencode-psi_0,target=/tmp/build-features-src/opencode-psi_0 \
25 | cp -ar /tmp/build-features-src/opencode-psi_0 /tmp/dev-container-features \
--------------------
[2026-08-04T06:11:06.442Z]
ERROR: failed to build: failed to solve: failed to process "\"${localEnv:MY_API_
_KEY}\"": unsupported modifier (:M) in substitution
The issue seems to be that the "localEnv:" substring is not getting substituted before being passed to Docker, whose parser then trips on ":M" (or apparently any other colon-letter combination). Indeed, the error message goes away by inserting a hyphen after the colon:
"containerEnv": {
"MY_API_KEY": "${localEnv:-MY_API_KEY}"
}
But then the value passed into the container environment is the literal string "MY_API_KEY:":
env | grep MY_API_KEY
MY_API_KEY=MY_API_KEY:
- Ngôn ngữ chính
- Shell
- Star
- 1.5k
- Fork
- 624
- Merge trung bình
- 4 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 7
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/features
-
use mise for java feature installation or make sdkman configuable to download JDK from mirrosĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
devcontainers/features#1730 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Version resolution over unauthenticated git makes feature installs fail hard, with no fallbackCó thể đã có người làm @v-Kaniska244 đã nhận 33 ngày trước. Đang mở
devcontainers/features#1726 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
-
[docker-in-docker] v4 with iptablesSwitchAtRuntime:true default on Ubuntu 26.04 host/devcontainer image activates iptables-legacy instead of iptables-nftCó thể làm lại được @v-Kaniska244 đã nhận 51 ngày trước và không có pull request nào đang mở. Đang mở
devcontainers/features#1709 · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
devcontainers/features#1707 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
devcontainers/features#1699 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của devcontainers/features
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mesonbuild/wrapdb#2961 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
command: monitor command: update info: steamcmd reproducible: always severity: medium type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
GameServerManagers/LinuxGSM#4997 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:space-accuracy good first issue track:data
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Sara-Managed-Projects/space-radar#886 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug-unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/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 82/100
zerocracy/judges-action#2733 ·
Maintainer thường phản hồi trong vòng 8 ngày