Skip to content

whim v0.2.0 — build custom MicroVM images from source

Choose a tag to compare

@udgover udgover released this 03 Jul 08:49
· 17 commits to main since this release
v0.2.0
709e219

whim init builds the default sandbox image; this release adds whim build to build custom images from your own source — no git, no Docker, and no new third-party dependencies.

whim build ./app          --name whim-app                 # local dir (Dockerfile at its root)
whim build ./Dockerfile   --name whim-min  --egress none  # single local Dockerfile, airgapped
whim build s3://my-bucket/app.zip      --name whim-s3  --json
whim build https://example.com/app.zip --name whim-https
GITHUB_TOKEN=… whim build github.com/org/repo@<full-sha> --name whim-repo --force

What's new

  • microvm.BuildFromSource — orchestrates classify → reuse-or-force → stage → EnsureImage, reusing the existing image lifecycle. New sentinels ErrInvalidSource and ErrSourceTooLarge.
  • Four source kinds: a local directory or Dockerfile, an s3://bucket/key object, an https:// archive/raw Dockerfile, and GitHub shorthand (github.com/org/repo@ref, CLI-only — lowers to an HTTPS archive download).
  • --name is the cache key. A second whim build --name X reuses image X unless you pass --force (delete + rebuild). A changed source does not trigger a rebuild on its own.
  • --egress public|none fixes the image's outbound policy at build time, inherited by every VM launched from it (none is airgapped).
  • --context-subdir

    descends into a subdirectory before locating the Dockerfile (also strips a wrapping top-level dir from forge archives).

  • --json prints one redacted result object and suppresses progress output.
  • GitHub auth via GITHUB_TOKEN — sent only as a request header, never in a URL, never logged or written to config. Use a full commit SHA for an immutable source identity (branches/tags are moving targets).

Safety & limits

Every source — local, S3, and HTTPS alike — is validated and normalized before any build: archives are re-rooted, and absolute/../duplicate paths and root-escaping symlinks (including via --context-subdir) are rejected. Caps: 256 MiB compressed, 1 GiB uncompressed, 10,000 files. A .dockerignore at the context root is honored for a documented subset (blank lines, #
comments, ! negation, leading-/ anchoring, trailing-/ dir matches, */? single-segment globs); unsupported constructs (**, […]) are rejected rather than silently mis-applied.

Compatibility

Purely additive — every v0.1.0 command and library call is unchanged. Custom image names are cached alongside the default image in ~/.config/whim/config.json, in a format that survives whim init and cache clears.

Not in this release

Private-ECR base images — the build role's IAM is intentionally not widened until that path is validated. whim build builds on the same managed base image as whim init.

Install

go install github.com/udgover/whim/cmd/whim@v0.2.0