You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Problem
When a
devcontainer.jsondefines a mount using${localEnv:SSH_AUTH_SOCK}and the environment variable is unset or empty, the CLI resolves it to an empty string and passessource=,target=/run/ssh-agent.sock,type=bindtodocker run. Docker rejects this:This is particularly problematic when using pre-built images (via
devcontainers/ci) because the mount is baked into the image'sdevcontainer.metadatalabel and cannot be overridden at runtime (the spec merges mount arrays by concatenation).Expected behavior
When
${localEnv:VAR}resolves to empty in a mount'ssource, the CLI should skip that mount entirely rather than passing an invalid empty source to Docker.Reproduction
devcontainer.jsonwith:devcontainer upin an environment whereSSH_AUTH_SOCKis unsetContext
SSH_AUTH_SOCKset but the runtime host does not