Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,190 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

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 21/4/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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
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

Mở trong Codespaces

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.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của devcontainers/cli

Tất cả issue của devcontainers/cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.