Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,190 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

@v-Kaniska244 がすでに取り組んでいます。

2026年4月21日 から。

評価

この issue はまだ評価されていません。

説明

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
主要言語
TypeScript
スター
3k
フォーク
461
平均マージ
18分
マージ済み PR(30日)
5

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

devcontainers/cli のほかの issue

devcontainers/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。