Skip to content

feat(cli): add repeatable --mount flag to up command#295

Merged
skevetter merged 1 commit into
mainfrom
4309-mount-cli-flag
May 15, 2026
Merged

feat(cli): add repeatable --mount flag to up command#295
skevetter merged 1 commit into
mainfrom
4309-mount-cli-flag

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Summary

  • Adds a repeatable --mount CLI flag to the up command, allowing users to pass additional container mounts at runtime (e.g., --mount type=bind,source=/host/path,target=/container/path)
  • Mount strings use the same format as Docker's --mount flag and the devcontainer spec's mounts property — comma-separated key=value pairs with type, source/src, and target/dst/destination
  • CLI mounts are merged with any mounts defined in devcontainer.json; the existing mergeMounts deduplication (by target path) applies
  • Includes validation that each --mount value contains a target

Spec alignment

The --mount flag accepts the devcontainer spec's string format for mounts: type=<type>,source=<src>,target=<dst>[,<key>=<value>...]. This is the same syntax Docker's --mount flag uses, which the spec explicitly references ("each value accepts the same values as the Docker CLI --mount flag"). All mount types supported by the existing ParseMount function (bind, volume, tmpfs, etc.) work with the new flag.

Changes

File Change
pkg/provider/workspace.go Add Mounts []string to CLIOptions
cmd/up/up_flags.go Register --mount as StringArrayVar
cmd/up/up_validate.go Add validateMounts — requires target on each mount
pkg/devcontainer/config.go Parse CLI mount strings and append to config in substitute()
cmd/up/up_test.go Unit tests for flag registration, parsing, repeatability, and validation
pkg/devcontainer/config_test.go Unit tests for CLI mount merging (append, merge with existing, empty)
e2e/tests/up/provider_docker.go E2e test: --mount creates expected volume mount in container

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.
@netlify

netlify Bot commented May 14, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 21cb5a3
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a065b91831b1b000845f291

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@skevetter has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 48573f40-502e-492f-932c-6f688c291a61

📥 Commits

Reviewing files that changed from the base of the PR and between 2d4b112 and 21cb5a3.

📒 Files selected for processing (7)
  • cmd/up/up_flags.go
  • cmd/up/up_test.go
  • cmd/up/up_validate.go
  • e2e/tests/up/provider_docker.go
  • pkg/devcontainer/config.go
  • pkg/devcontainer/config_test.go
  • pkg/provider/workspace.go

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@skevetter
skevetter marked this pull request as ready for review May 14, 2026 23:52
@skevetter
skevetter enabled auto-merge (squash) May 14, 2026 23:53
@skevetter
skevetter merged commit 7db7af3 into main May 15, 2026
57 checks passed
@skevetter
skevetter deleted the 4309-mount-cli-flag branch May 15, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant