novita template create builds a Dockerfile directly into a reusable sandbox template. It reads the Dockerfile, builds the image, applies sandbox settings (start / ready command, CPU, memory, disk size), and registers the result under the template name — which you can then pass to sandbox.create(...).
Usage
CLI
Argument
Options
Behavior and validation
- Authentication is required: log in with
novita auth loginor setNOVITA_API_KEYin the environment. - Providing
--cmdwithout--ready-cmdfails withBoth start and ready commands must be provided.;--ready-cmdalone is allowed. - An invalid template name or an odd
--memory-mbvalue aborts the build before anything is sent to the server. - A
--disk-size-mbvalue that is not an integer or is below1024aborts the build before anything is sent to the server. A value that is not a multiple of1024, or that exceeds your account’s disk quota, is rejected by the server. - Build logs are streamed to the terminal. On success the CLI prints Python / JS snippets showing how to create a sandbox from the new template.
Examples
An example Dockerfile used by the commands below:Dockerfile
Minimal build
Reads./novita.Dockerfile (or ./Dockerfile) in the current directory:
CLI
Specify a Dockerfile explicitly
Point the build at a specific Dockerfile relative to the root directory:CLI
Full build
Custom root directory, resources (including disk size), start/ready commands, and no cache:CLI
JavaScript & TypeScript