Skip to content
pols.so docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

pols template

Save sandboxes as templates, build them from images, and manage them

Save sandboxes as templates, build them from images, and manage them

Usage

pols template [command]

Subcommands

Command Description
pols template build Build a template from a public OCI image or a Dockerfile
pols template ls List templates
pols template rm Delete a template
pols template save Save a sandbox’s disk as a template (its env vars are not copied)

Flags

-h, --help   help for template

pols template build

Build a template from a public OCI image (--image) or a Dockerfile (--dockerfile FILE, - for stdin, built in --context or an empty context; or --context alone, built with its own Dockerfile). pols pulls or builds it in a build sandbox and adds the image’s files to the default template’s: the base’s own files win, except under /usr/local and /opt, and the image’s ENV is exported to login shells. ENTRYPOINT, CMD, USER, WORKDIR and the image’s accounts are not used. Waits until the template is ready.

Usage

pols template build NAME [flags]

Examples

pols template build py312 --image python:3.12-slim
pols template build app --dockerfile ./Dockerfile
pols template build app --context https://github.com/org/repo.git#main:docker

Flags

    --context string           public build context URL: a Git repository (https://host/org/repo.git#ref:dir) or a tarball
    --description string       what the template is for
    --dockerfile string        Dockerfile to build (- for stdin)
-h, --help                     help for build
    --idempotency-key string   make the build safe to retry, as for template save
    --image string             public OCI image with a linux/amd64 variant, like python:3.12-slim
    --size string              build sandbox size, whose disk the template gets (default small, 20 GiB)

pols template ls

List templates

Usage

pols template ls [flags]

Flags

-h, --help   help for ls

pols template rm

Delete a template

Usage

pols template rm TEMPLATE [flags]

Flags

-h, --help   help for rm

pols template save

Save a sandbox’s disk as a template (its env vars are not copied)

Usage

pols template save SANDBOX NAME [flags]

Flags

    --description string       what the template is for
-h, --help                     help for save
    --idempotency-key string   make the save safe to retry: run again with the same key and arguments within 24 hours, it returns the template the first run saved instead of saving another

The global flags work with this command too.