feat(cli): add repeatable --mount flag to up command#295
Conversation
Allow users to pass additional container mounts at runtime via `--mount type=bind,source=/host,target=/container`. The flag is repeatable, accepts the same string format as Docker's --mount and the devcontainer spec's mounts property, and merges with any mounts defined in devcontainer.json.
✅ Deploy Preview for devsydev canceled.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
--mountCLI flag to theupcommand, allowing users to pass additional container mounts at runtime (e.g.,--mount type=bind,source=/host/path,target=/container/path)--mountflag and the devcontainer spec'smountsproperty — comma-separated key=value pairs withtype,source/src, andtarget/dst/destinationdevcontainer.json; the existingmergeMountsdeduplication (by target path) applies--mountvalue contains atargetSpec alignment
The
--mountflag accepts the devcontainer spec's string format for mounts:type=<type>,source=<src>,target=<dst>[,<key>=<value>...]. This is the same syntax Docker's--mountflag uses, which the spec explicitly references ("each value accepts the same values as the Docker CLI--mountflag"). All mount types supported by the existingParseMountfunction (bind, volume, tmpfs, etc.) work with the new flag.Changes
pkg/provider/workspace.goMounts []stringtoCLIOptionscmd/up/up_flags.go--mountasStringArrayVarcmd/up/up_validate.govalidateMounts— requirestargeton each mountpkg/devcontainer/config.gosubstitute()cmd/up/up_test.gopkg/devcontainer/config_test.goe2e/tests/up/provider_docker.go--mountcreates expected volume mount in container