In short: a template starts from a Docker image. Building one feels similar to authoring a Dockerfile, but you describe the steps with the SDK (
fromImage, runCmd, copy, setEnvs, …) instead of a Dockerfile. The output is a templateId that Novita uses to launch sandboxes quickly.
Build
Once a template definition is ready, usenovita.template.build(...) to build it.
Names
Every build needs a template name. Keep names stable for a logical template family. The returned template ID is the immutable build output you use at runtime.Base Image
A template definition always starts by choosing a base image (or an existing template) with one of thefrom* methods.
User and Workdir
After choosing a base image, you can control which user subsequent build steps run as and which directory they run in.Tags & versioning
Tags let you label builds for release management without changing the underlying template name.Logging
Build logs help you inspect provisioning progress and diagnose failures.Error handling
Template builds can fail for several common reasons:- invalid credentials for a private registry
- package install failures inside
runCmd(...)/run_cmd(...) - a start command that exits unexpectedly
- a ready command that never succeeds
- CPU and memory settings that do not satisfy platform limits