Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Parser failure on "localEnv:" in devcontainer-feature.json

Abierto
#1,704 0 comentarios 1 reacción 1 asignado Ver en GitHub

Los mantenedores suelen responder en 5 días

@v-Kaniska244 ya está trabajando en esto.

Desde el 5/8/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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:
Lenguaje dominante
Shell
Estrellas
1.5k
Forks
624
Merge medio
4 d 8 h
PR fusionados (30 d)
7

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de devcontainers/features

Todos los issues de devcontainers/features

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.