Skip to content

feat(cli): add --from flag to sandbox create for unified image sources - #89

Merged
drew merged 3 commits into
mainfrom
88-sandbox-from-flag
Mar 5, 2026
Merged

feat(cli): add --from flag to sandbox create for unified image sources#89
drew merged 3 commits into
mainfrom
88-sandbox-from-flag

Conversation

@drew

@drewdrew commented Mar 4, 2026

Copy link
Copy Markdown
Collaborator

Closes#88

Summary

  • Replaces --image with a unified --from flag on ncl sandbox create that accepts community sandbox names (openclaw), Dockerfile paths, directories with Dockerfiles, and full container image references
  • Adds resolve_from() heuristic that classifies the input and either resolves it to an image reference or builds from a Dockerfile automatically before creating the sandbox
  • Community sandbox names are expanded to ghcr.io/nvidia/nemoclaw-community/sandboxes/<name>:latest (overridable via NEMOCLAW_COMMUNITY_REGISTRY env var)

How it works

The --from value is classified in order:

InputExampleBehavior
Existing file with "Dockerfile" in name--from ./DockerfileBuild + push + create
Existing directory with Dockerfile--from ./my-sandbox/Build + push + create
Contains /, :, or .--from myregistry.com/img:tagUse as image directly
Bare name--from openclawResolve to community GHCR image

For Dockerfile sources, the CLI reuses the existing build_and_push_image pipeline to build locally and import into the cluster's containerd — same mechanism as ncl sandbox image push.

Files changed

  • crates/navigator-cli/src/run.rsResolvedSource enum, resolve_from(), build_from_dockerfile() helper, updated sandbox_create/sandbox_create_with_bootstrap signatures
  • crates/navigator-cli/src/main.rs--image--from in CLI args and dispatch
  • architecture/sandbox-custom-containers.md — Rewritten with --from documentation
  • CONTRIBUTING.md — Updated examples
  • examples/bring-your-own-container/README.md — Updated examples
  • e2e/bash/test_sandbox_custom_image.sh — Updated --image--from

Test plan

  • All 39 navigator-cli unit/integration tests pass
  • All 7 bootstrap build tests pass
  • cargo clippy — no new warnings
  • cargo fmt --check — clean
  • E2E test updated (requires cluster to run)

@drewdrew self-assigned this Mar 4, 2026
@drew
drewforce-pushed the 88-sandbox-from-flag branch from accdbc8 to 4ec2c8bCompareMarch 5, 2026 02:09
drew added 2 commits March 4, 2026 20:36
The sandbox create --from flag already handles Dockerfile builds,
image references, and community sandbox names. The separate
sandbox image push command is redundant and adds unnecessary
surface area to the CLI.
@drew
drew merged commit 53a84cc into mainMar 5, 2026
10 checks passed
@drew
drew deleted the 88-sandbox-from-flag branch March 5, 2026 05:15
@drew
drew restored the 88-sandbox-from-flag branch March 5, 2026 06:17
@drew
drew deleted the 88-sandbox-from-flag branch March 5, 2026 07:13
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): add --from flag to sandbox create for unified image sources

1 participant

@drew