cli icon indicating copy to clipboard operation
cli copied to clipboard

Proposal: add flag to skip bind mounts where host folder doesn't exist

Open stuartleeks opened this issue 3 years ago • 2 comments

When working with dev containers locally (e.g. in Visual Studio Code), it can be productive to mount host folders in the container (e.g. .azure to share login credentials into the container).

When using such a dev container in CI, you can run into issues because the host folder doesn't exist (see https://github.com/devcontainers/ci/issues/166).

One way to address this would be to add a --skip-non-existent-bind-mounts flag, and have the CLI strip out any bind mounts where the host folder doesn't exist. This flag wouldn't be specified via VS Code (preserving the existing behaviour), but could be specified in CI if desired (e.g. added as an option to https://github.com/devcontainers/ci)

stuartleeks avatar Sep 08 '22 06:09 stuartleeks

This idea also applies to cloud scenarios like Codespaces.

edgonmsft avatar Sep 08 '22 16:09 edgonmsft

Aren't some of the mounts "environment" specific? For example, VSCode mounts the source directory, git config and ssh agent socket without an explicit declaration in devcontainer.json.

Maybe this is a discussion that's already happened but devcontainer.json should assume as little as possible about the host.

kewne avatar Apr 17 '24 13:04 kewne