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), 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. - 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, start/ready commands, and no cache:CLI
JavaScript & TypeScript