Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Empty ${localEnv:} in mount source should skip the mount, not pass empty source to Docker

Aperta
#1,190 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@v-Kaniska244 ci sta già lavorando.

Dal 21/4/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Problem

When a devcontainer.json defines a mount using ${localEnv:SSH_AUTH_SOCK} and the environment variable is unset or empty, the CLI resolves it to an empty string and passes source=,target=/run/ssh-agent.sock,type=bind to docker run. Docker rejects this:

invalid argument "source=,target=/run/ssh-agent.sock,type=bind" for "--mount" flag: invalid value for 'source': value is empty

This is particularly problematic when using pre-built images (via devcontainers/ci) because the mount is baked into the image's devcontainer.metadata label and cannot be overridden at runtime (the spec merges mount arrays by concatenation).

Expected behavior

When ${localEnv:VAR} resolves to empty in a mount's source, the CLI should skip that mount entirely rather than passing an invalid empty source to Docker.

Reproduction

  1. Create a devcontainer.json with:
    "mounts": [
      "source=${localEnv:SSH_AUTH_SOCK},target=/run/ssh-agent.sock,type=bind"
    ]
    
  2. Run devcontainer up in an environment where SSH_AUTH_SOCK is unset
  3. Observe Docker failure due to empty mount source

Context

  • CLI version: 0.85.0
  • Related: devcontainers/ci#166 (request to disable mounts in CI builds)
  • This affects any CI/CD environment that uses pre-built devcontainer images where the build host had SSH_AUTH_SOCK set but the runtime host does not
Lingua principale
TypeScript
Stelle
3k
Fork
461
Merge medio
18m
PR unite (30g)
5

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di devcontainers/cli

Tutte le issue di devcontainers/cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.