You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/SYSTEM_DESIGN.md
+66Lines changed: 66 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -457,3 +457,69 @@ clawsandbox list
457
457
docker stats claw-1 claw-2
458
458
# → Confirm memory stays within memory_limit
459
459
```
460
+
461
+
## 11. Version Management
462
+
463
+
A single `git tag` locks both the CLI binary and Docker image to the same version, with automated publishing to GitHub Release and GHCR.
464
+
465
+
### Architecture
466
+
467
+
```
468
+
git tag v0.1.0 && git push origin v0.1.0
469
+
│
470
+
▼
471
+
GitHub Actions
472
+
┌──────────────────┬──────────────────────┐
473
+
│ GoReleaser │ Docker Build+Push │
474
+
│ CLI binaries x4 │ ghcr.io image │
475
+
│ (darwin/linux │ :0.1.0 + :latest │
476
+
│ x amd64/arm64) │ │
477
+
└────────┬─────────┴──────────┬─────────────┘
478
+
▼ ▼
479
+
GitHub Release ghcr.io/weiyong1024/clawsandbox
480
+
```
481
+
482
+
### Shared version package (`internal/version/`)
483
+
484
+
Version metadata (`Version`, `GitCommit`, `BuildDate`) is injected at build time via ldflags into `internal/version`. Both `internal/cli/version.go` and `internal/config/config.go` import from this shared package.
485
+
486
+
The `ImageTag()` helper derives the Docker image tag from the CLI version:
487
+
- Release build (e.g. `v0.1.0`): returns `0.1.0`
488
+
- Dev build (no tag): returns `latest`
489
+
490
+
### Image naming and tagging
491
+
492
+
-**Registry**: `ghcr.io/weiyong1024/clawsandbox`
493
+
-**Default tag**: determined at runtime via `version.ImageTag()`
494
+
-`clawsandbox build` tags the image with both `:<version>` and `:latest`
495
+
-`clawsandbox create` uses `:<version>` to ensure CLI-image version consistency
496
+
497
+
### Auto-pull on create
498
+
499
+
When `clawsandbox create` (or the Dashboard's create action) finds the image missing locally, it automatically attempts `docker pull` from GHCR before failing. Users with internet access never need to run `clawsandbox build`.
0 commit comments