Create a Package
The following diagram shows the order of operations for the zarf package create command and the hook locations for actions.
Lifecycle Diagram
Package Templates
Use zarf dev template to render a package or component definition before creating a package. Templates use Go template syntax with [[ and ]] delimiters. The rendered definition is included in the package, so its template values cannot be changed after creation.
For example, save this definition as zarf.tpl.yaml:
apiVersion: zarf.dev/v1beta1kind: ZarfPackageConfigmetadata: name: app version: "[[ .VERSION ]]"components: - name: app images: - name: "[[ .IMAGE ]]"Render the template and create the package from the generated definition:
zarf dev template --set VERSION=1.0.0 --set IMAGE=ghcr.io/example/app:1.0.0zarf package create zarf.gen.yamlYou can also provide a YAML mapping with --set-file template-values.yaml. Values passed with --set take precedence over the file. Template keys are case-sensitive, and missing values cause an error. Rendering validates the generated definition and writes it alongside the template with a .gen.yaml suffix.
Render local component templates separately and use their generated paths in import.local[].path. Render remote components before publishing them.
Do not put sensitive data in package templates: rendered values are stored in the package. For configuration supplied at deploy time, see Package Values.
Differential Packages
The --differential flag accepts another Zarf package (local or OCI) as a reference. Images and Git repositories that exist in both packages are excluded from the new
package, reducing its size. This is especially useful in environments where large data transfers are costly or time-consuming. View the Differential Package Tutorial for an example.