Skip to content

Host mounts saved in the config aren't expanded or checked like --mount #25

Open

Description

@TheDreamSaver

What happens

Host mounts given on the command line (--mount, --desktop) go through expandHostPath(), plus an existence check, in src/commands/start.ts. Host mounts saved in the config (sandbox.hostMounts) skip both: resolveHostMounts() copies them as-is, and buildRunFlags() passes each one straight to --volume ${mount.source}:${mount.target}:${mount.mode} (src/docker/templates.ts).

So a saved source such as ~/data or ./data reaches Docker unexpanded. Docker rejects it, or, for a bare name like data, mounts a named volume instead of the host folder. A saved source that no longer exists is created by Docker (owned by root on Linux), where --mount would refuse.

Nothing in the CLI writes sandbox.hostMounts today, so this affects hand-edited configs. It'll matter more with declarative workspaces (#14).

Expected

Saved host mounts get the same treatment as --mount: ~ expanded and the source checked to exist. For a relative or bare-name source, the same legacy question as the workspace in #24 applies. A bare name may be an existing Docker volume holding data, so it should be kept with a warning rather than silently remapped.

Raised by @Asdivyansh in the #24 review.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions