Builds a template from a Dockerfile and a build context (default: the
current directory), streaming the build log. The gateway builds it with
BuildKit in an isolated builder, adds the Anona runtime (envd), pushes it and
registers it; sandboxes then start from it by name:
anona-compute template build -f Dockerfile --name my-env
anona-compute create -t my-env
Every FROM image is pinned by digest. EXPOSE 49983 (envd) is refused. The
image's CMD runs at sandbox start only when the last stage declares CMD or
ENTRYPOINT, or with --start-cmd. .dockerignore in the context is honored.
Usage
anona-compute template build [CONTEXT_DIR] [flags]
Flags
| Flag | Type | Description |
|---|---|---|
--cpu | int | vCPUs of sandboxes from this template (default 2) |
--file, -f | string | Dockerfile (default CONTEXT_DIR/Dockerfile) |
--help, -h | help for build | |
--memory | int | memory of sandboxes from this template, MiB (default 2048) |
--name, -n | string | template name (default: the context directory’s name) |
--no-cache | build without the build cache | |
--start-cmd | string | command to run when a sandbox starts (after envd) |
--tag | stringArray | tag for this build (repeatable) |
--wait | stream the build log and wait until it is ready (—wait=false returns at once) (default true) |
--api-key, --api-url, --json, --output, --profile, --request-timeout, --verbose) work on every command; see anona-compute.