werf
  • Getting Started
  • Documentation
  • Kubernetes guide
  • About
    • Publications
    • Release channels
    • Changelog
  • English
    • English
    • Russian
✕
Join the party at CNCF Slack
Step 1:
Get an invite to CNCF Slack
Step 2:
Join #werf channel
We've chosen CNCF Slack since most of the Kubernetes community members are there.
v2.32.2
  1. v2.32
  2. Reference
  3. werf.yaml
Version: v2.32.2
  • latest
  • 2-rock-solid 2.36.4
  • 2-stable 2.36.4
  • 2-ea 2.36.4
  • 2-beta 2.37.1
  • 2-alpha 2.37.1
  • 1.2-rock-solid 1.2.334
  • 1.2-stable 1.2.334
  • 1.2-ea 1.2.334
  • 1.2-beta 1.2.334
  • 1.2-alpha 1.2.334
  • Getting started
  • Usage
    • Project configuration
      • Overview
      • Giterminism
    • Build
      • Overview
      • Images and dependencies
      • Stapel image configuration
        • Overview
        • Base image
        • Adding source code from git repositories
        • User instructions
        • Importing from images
        • Dockerfile instructions
        • Reducing image size and speeding up a build by mounts
      • Build backends
      • Build process
    • Deploy
      • Overview
      • Charts and dependencies
      • Templates
      • Parametrize templates
      • Multiple environments
      • Deployment order
      • Deployment scenarios
      • Planning
      • Resource tracking
      • Authentication and authorization
      • Release management
    • Distribute
      • Overview
      • Images
      • Bundles and charts
    • Cleanup
      • Container registry cleanup
      • Automatic host cleanup
    • Integration with CI/CD systems
  • Reference
    • werf.yaml
    • werf.yaml template engine
    • werf-giterminism.yaml
    • Deploy annotations
    • werf images
    • Command line interface
      • Overview of command groups
      • Delivery commands
        • werf converge
        • werf plan
        • werf dismiss
        • werf bundle
          • werf bundle apply
          • werf bundle copy
          • werf bundle publish
          • werf bundle render
      • Cleaning commands
        • werf cleanup
        • werf purge
      • Helper commands
        • werf ci-env
        • werf build
        • werf export
        • werf run
        • werf kube-run
        • werf compose
          • werf compose config
          • werf compose down
          • werf compose run
          • werf compose up
        • werf slugify
        • werf render
      • Low-level management commands
        • werf config
          • werf config graph
          • werf config list
          • werf config render
        • werf managed-images
          • werf managed-images add
          • werf managed-images ls
          • werf managed-images rm
        • werf host
          • werf host cleanup
          • werf host purge
        • werf helm
          • werf helm create
          • werf helm dependency
            • werf helm dependency build
            • werf helm dependency list
            • werf helm dependency update
          • werf helm env
          • werf helm get
            • werf helm get all
            • werf helm get hooks
            • werf helm get manifest
            • werf helm get metadata
            • werf helm get notes
            • werf helm get values
          • werf helm get-autogenerated-values
          • werf helm get-namespace
          • werf helm get-release
          • werf helm history
          • werf helm install
          • werf helm lint
          • werf helm list
          • werf helm package
          • werf helm plugin
            • werf helm plugin install
            • werf helm plugin list
            • werf helm plugin uninstall
            • werf helm plugin update
          • werf helm pull
          • werf helm registry
            • werf helm registry login
            • werf helm registry logout
          • werf helm repo
            • werf helm repo add
            • werf helm repo index
            • werf helm repo list
            • werf helm repo remove
            • werf helm repo update
          • werf helm rollback
          • werf helm search
            • werf helm search hub
            • werf helm search repo
          • werf helm secret
            • werf helm secret decrypt
            • werf helm secret encrypt
            • werf helm secret file
              • werf helm secret file decrypt
              • werf helm secret file edit
              • werf helm secret file encrypt
            • werf helm secret generate-secret-key
            • werf helm secret rotate-secret-key
            • werf helm secret values
              • werf helm secret values decrypt
              • werf helm secret values edit
              • werf helm secret values encrypt
          • werf helm show
            • werf helm show all
            • werf helm show chart
            • werf helm show crds
            • werf helm show readme
            • werf helm show values
          • werf helm status
          • werf helm template
          • werf helm test
          • werf helm uninstall
          • werf helm upgrade
          • werf helm verify
          • werf helm version
        • werf cr
          • werf cr login
          • werf cr logout
        • werf kubectl
          • werf kubectl alpha
          • werf kubectl annotate
          • werf kubectl api-resources
          • werf kubectl api-versions
          • werf kubectl apply
            • werf kubectl apply edit-last-applied
            • werf kubectl apply set-last-applied
            • werf kubectl apply view-last-applied
          • werf kubectl attach
          • werf kubectl auth
            • werf kubectl auth can-i
            • werf kubectl auth reconcile
            • werf kubectl auth whoami
          • werf kubectl autoscale
          • werf kubectl certificate
            • werf kubectl certificate approve
            • werf kubectl certificate deny
          • werf kubectl cluster-info
            • werf kubectl cluster-info dump
          • werf kubectl completion
          • werf kubectl config
            • werf kubectl config current-context
            • werf kubectl config delete-cluster
            • werf kubectl config delete-context
            • werf kubectl config delete-user
            • werf kubectl config get-clusters
            • werf kubectl config get-contexts
            • werf kubectl config get-users
            • werf kubectl config rename-context
            • werf kubectl config set
            • werf kubectl config set-cluster
            • werf kubectl config set-context
            • werf kubectl config set-credentials
            • werf kubectl config unset
            • werf kubectl config use-context
            • werf kubectl config view
          • werf kubectl cordon
          • werf kubectl cp
          • werf kubectl create
            • werf kubectl create clusterrole
            • werf kubectl create clusterrolebinding
            • werf kubectl create configmap
            • werf kubectl create cronjob
            • werf kubectl create deployment
            • werf kubectl create ingress
            • werf kubectl create job
            • werf kubectl create namespace
            • werf kubectl create poddisruptionbudget
            • werf kubectl create priorityclass
            • werf kubectl create quota
            • werf kubectl create role
            • werf kubectl create rolebinding
            • werf kubectl create secret
              • werf kubectl create secret docker-registry
              • werf kubectl create secret generic
              • werf kubectl create secret tls
            • werf kubectl create service
              • werf kubectl create service clusterip
              • werf kubectl create service externalname
              • werf kubectl create service loadbalancer
              • werf kubectl create service nodeport
            • werf kubectl create serviceaccount
            • werf kubectl create token
          • werf kubectl debug
          • werf kubectl delete
          • werf kubectl describe
          • werf kubectl diff
          • werf kubectl drain
          • werf kubectl edit
          • werf kubectl events
          • werf kubectl exec
          • werf kubectl explain
          • werf kubectl expose
          • werf kubectl get
          • werf kubectl kustomize
          • werf kubectl label
          • werf kubectl logs
          • werf kubectl options
          • werf kubectl patch
          • werf kubectl plugin
            • werf kubectl plugin list
          • werf kubectl port-forward
          • werf kubectl proxy
          • werf kubectl replace
          • werf kubectl rollout
            • werf kubectl rollout history
            • werf kubectl rollout pause
            • werf kubectl rollout restart
            • werf kubectl rollout resume
            • werf kubectl rollout status
            • werf kubectl rollout undo
          • werf kubectl run
          • werf kubectl scale
          • werf kubectl set
            • werf kubectl set env
            • werf kubectl set image
            • werf kubectl set resources
            • werf kubectl set selector
            • werf kubectl set serviceaccount
            • werf kubectl set subject
          • werf kubectl taint
          • werf kubectl top
            • werf kubectl top node
            • werf kubectl top pod
          • werf kubectl uncordon
          • werf kubectl version
          • werf kubectl wait
      • Other commands
        • werf synchronization
        • werf completion
        • werf version
  • Resources
    • Cheat sheet
    • Migration from v1.2 to v2.0
    • Comparison with other tools
    • Telemetry
Source

werf.yaml

0 --- # Meta section
...
1 project: string ! # Unique project name
2 configVersion: int ! # Config syntax version. It should always be 1 for now
3 build: # Common build settings
...
4   cacheVersion: string # Cache version
5   platform: [ string, ... ] # Common list of target platforms for all images (for example ['linux/amd64', 'linux/arm64', 'linux/arm/v8'])
6   staged: bool # Enable layer-by-layer caching of Dockerfile instructions in container registry globally for all images
7   imageSpec: # Global image configuration options according to the OCI specification, which will be applied to all images. More details here
...
8     author: string # Author of the image
9     clearHistory: bool # Remove all image build history
10     config: # Common image configuration
...
11       clearWerfLabels: bool # Clear werf labels
12       removeLabels: [ string || /REGEXP/, ... ] # List of labels to remove
13 deploy: # Settings for deployment
...
14   helmChartDir: string # Path to the helm chart directory of the project (default .helm)
15   helmChartConfig: # Override Chart.yaml configuration
...
16     appVersion: string # Override appVersion in Chart.yaml (default )
17   helmRelease: string # Release name template (default [[ project ]]-[[ env ]])
18   helmReleaseSlug: bool # Release name slugification (default true)
19   namespace: string # Kubernetes namespace template (default [[ project ]]-[[ env ]])
20   namespaceSlug: bool # Kubernetes namespace slugification (default true)
21 cleanup: # Settings for cleaning up irrelevant images
...
22   disableKubernetesBasedPolicy: bool # Disable a cleanup policy that allows not to remove images deployed in Kubernetes from the container registry
23   disableGitHistoryBasedPolicy: bool # Disable a cleanup policy that allows not to remove images taking into account user-defined policies by the Git history (keepPolicies)
24   disableBuiltWithinLastNHoursPolicy: bool # Disable a cleanup policy that allows not to remove images built in last hours (keepImagesBuiltWithinLastNHours)
25   keepImagesBuiltWithinLastNHours: uint # The minimum number of hours that must elapse since the image is built (default 2)
26   keepPolicies: # Set of policies to select relevant image versions using the Git history
27   - references: # References to perform scanning on
28       branch: string || /REGEXP/ # One or more git origin branches
29       tag: string || /REGEXP/ # One or more git origin tags
30       limit: # The set of rules to limit references on the basis of the date when the git tag was created or the activity in the git branch
31         last: int # To select n last references last n references from those defined in the branch or tag (default -1)
32         in: duration string # To select git tags that were created during the specified period or git branches that were active during the period
33         operator: And || Or # Check both conditions or any of them (default And)
34     imagesPerReference: # The limit on the number of image versions for each reference contained in the set
35       last: int # The number of image versions to search for each reference (default -1)
36       in: duration string # The time frame in which werf searches for images
37 gitWorktree: # Configure how werf handles git worktree of the project
...
38   forceShallowClone: bool # Force werf to use shallow clone despite restrictions
39   allowUnshallow: bool # Allow werf to automatically convert project shallow git clone to full one during build process when needed (default true)
40   allowFetchOriginBranchesAndTags: bool # Allow werf to synchronize git branches and tags with remote origin during cleanup process when needed (default true)
41 --- # Dockerfile image section: optional, define as many image sections as you need
...
42 image: string || [ string, ... ] ! # One or more unique names for image
43 final: bool # Mark image as final (default true). More details here
44 dockerfile: string ! # Dockerfile path relative to the context PATH
45 staged: bool # Enable layer-by-layer caching of Dockerfile instructions in container registry
46 cacheVersion: string # Cache version
47 context: string # Build context PATH inside project directory
48 platform: [ string, ... ] # List of target platforms for this image (for example ['linux/amd64', 'linux/arm64', 'linux/arm/v8'])
49 contextAddFiles: [ string, ... ] # Untracked files and directories for adding to build context. The paths must be relative to context PATH
50 target: string # Specific Dockerfile stage (last one by default, similar to the docker build --target option)
51 args: { name string: value string, ... } # Variables for ARG dockerfile instructions (similar to the docker build --build-arg option)
52 addHost: [ string, ... ] # Custom host-to-IP mapping (host:ip) (similar to the docker build --add-host option)
53 network: string # The networking mode for the RUN instructions during build (similar to the docker build --network option)
54 ssh: string # SSH agent socket or keys to the build (similar to the docker build --ssh option) (DEPRECATED). More details here
55 secrets: # Secrets used in image build. Only one of the following options can be used in a single instance: env, src, or value. More details here
56 - id: string # Secret unique identifier (mandatory only for the value type)
57   env: string # A secret from an environment variable
58   src: string # A secret from a file at the given path
59   value: string # Custom string value
60 dependencies: # Dependencies images for current image
...
61 - image: string # Dependency image name, which should be built before building current image
62   imports: # Define target build args to import image information into current image (optional)
63   - type: string # Type of image info: ImageName, ImageDigest, ImageRepo or ImageTag
64     targetBuildArg: string # Name of build argument which will contain specified type of information about image
65 imageSpec: # Image configuration according to the OCI specification. More details here
66   author: string # Author of the image
67   clearHistory: bool # Remove all image build history
68   config: # Common image configuration
...
69     clearWerfLabels: bool # Clear werf labels
70     removeLabels: [ string || /REGEXP/, ... ] # List of labels to remove
71     removeVolumes: [string, ...] # List of volumes to remove
72     removeEnv: [string, ...] # List of environment variables to remove
73     clearEntrypoint: bool # Remove ENTRYPOINT
74     clearCmd: bool # Remove CMD
75     volumes: [string, ...] # List of volumes to add. More details here
76     labels: { name string: value string, ... } # List of labels to add. More details here
77     env: { name string: value string, ... } # List of environment variables to add. More details here
78     expose: [string, ...] # Set exposed ports. More details here
79     user: string # Set user. More details here
80     cmd: [string, ...] # Set CMD. More details here
81     entrypoint: [string, ...] # Set ENTRYPOINT. More details here
82     workingDir: string # Set WORKDIR. More details here
83     stopSignal: string # Set STOPSIGNAL. More details here
84     healthcheck: { test: [string, ...], interval: string, retries: int } # Healthcheck configuration. Intervals are in seconds.. More details here
85 --- # Stapel image section: optional, define as many image sections as you need
...
86 image: string || [ string, ... ] ! # One or more unique names for image
87 artifact: string # The unique name for artifact (DEPRECATED). More details here
88 final: bool # Mark image as final (default true). More details here
89 cacheVersion: string # Cache version
90 platform: [ string, ... ] # List of target platforms for this image (for example ['linux/amd64', 'linux/arm64', 'linux/arm/v8'])
91 from: string # The name of a base image. More details here
92 fromLatest: bool # To use actual base image without caching. More details here
93 fromImage: string # To use image as base image by image name. More details here
94 fromArtifact: string # To use artifact as base image by artifact name (DEPRECATED)
95 fromCacheVersion: string # Cache version. More details here
96 disableGitAfterPatch: bool # Disable updating git sources (gitCache, gitLatestPatch stages). More details here
97 git: # Set of directives to add source files from git repositories (both the project repository and any other). More details here
...
98 - url: string # The address of the remote repository. More details here
99   branch: string # The branch name. More details here
100   commit: string # The commit
101   tag: string # The tag name
102   add: string # A source path in a repository. More details here
103   to: string # A destination path in image. More details here
104   owner: string # The name or UID of the owner. More details here
105   group: string # The name or GID of the owner’s group. More details here
106   includePaths: [ glob, ... ] # Globs for including. More details here
107   excludePaths: [ glob, ... ] # Globs for excluding. More details here
108   stageDependencies: # The organization of restarting assembly instructions when defined changes occur in the git repository. More details here
109     install: [ glob, ... ] # Globs for install stage
110     beforeSetup: [ glob, ... ] # Globs for beforeSetup stage
111     setup: [ glob, ... ] # Globs for setup stage
112 secrets: # Secrets used in image build. Only one of the following options can be used in a single instance: env, src, or value. More details here
113 - id: string # Secret unique identifier (mandatory only for the value type)
114   env: string # A secret from an environment variable
115   src: string # A secret from a file at the given path
116   value: string # Custom string value
117 shell: # Shell assembly instructions. More details here
...
118   beforeInstall: [ string, ... ] # Commands for beforeInstall stage. More details here
119   install: [ string, ... ] # Commands for install stage. More details here
120   beforeSetup: [ string, ... ] # Commands for beforeSetup stage. More details here
121   setup: [ string, ... ] # Commands for setup stage. More details here
122   cacheVersion: string # Common cache version. More details here
123   beforeInstallCacheVersion: string # Cache version for beforeInstall stage. More details here
124   installCacheVersion: string # Cache version for install stage. More details here
125   beforeSetupCacheVersion: string # Cache version for beforeSetup stage. More details here
126   setupCacheVersion: string # Cache version for setup stage. More details here
127 ansible: # Ansible assembly instructions. More details here
...
128   beforeInstall: [ task, ... ] # Tasks for beforeInstall stage. More details here
129   install: [ task, ... ] # Tasks for install stage. More details here
130   beforeSetup: [ task, ... ] # Tasks for beforeSetup stage. More details here
131   setup: [ task, ... ] # Tasks for setup stage. More details here
132   cacheVersion: string # Common cache version. More details here
133   beforeInstallCacheVersion: string # Cache version for beforeInstall stage. More details here
134   installCacheVersion: string # Cache version for install stage. More details here
135   beforeSetupCacheVersion: string # Cache version for beforeSetup stage. More details here
136   setupCacheVersion: string # Cache version for setup stage. More details here
137 imageSpec: # Image configuration according to the OCI specification. More details here
138   author: string # Author of the image
139   clearHistory: bool # Remove all image build history
140   config: # Common image configuration
...
141     clearWerfLabels: bool # Clear werf labels
142     removeLabels: [ string || /REGEXP/, ... ] # List of labels to remove
143     removeVolumes: [string, ...] # List of volumes to remove
144     removeEnv: [string, ...] # List of environment variables to remove
145     clearEntrypoint: bool # Remove ENTRYPOINT
146     clearCmd: bool # Remove CMD
147     volumes: [string, ...] # List of volumes to add. More details here
148     labels: { name string: value string, ... } # List of labels to add. More details here
149     env: { name string: value string, ... } # List of environment variables to add. More details here
150     expose: [string, ...] # Set exposed ports. More details here
151     user: string # Set user. More details here
152     cmd: [string, ...] # Set CMD. More details here
153     entrypoint: [string, ...] # Set ENTRYPOINT. More details here
154     workingDir: string # Set WORKDIR. More details here
155     stopSignal: string # Set STOPSIGNAL. More details here
156     healthcheck: { test: [string, ...], interval: string, retries: int } # Healthcheck configuration. Intervals are in seconds.. More details here
157 docker: # Set of directives to change the image manifest (DEPRECATED). Incompatible with the imageSpec directive. More details here
...
158   exactValues: bool # Set specified options values as-is, including unescaped quotes and spaces. Option affects only docker-server backend and does not affect buildah backend.
159   USER: string # The user name (or UID) and optionally the user group (or GID). More details here
160   WORKDIR: string # The working directory. More details here
161   VOLUME: [ string, ... ] # Mount points. More details here
162   ENV: { name string: value string, ... } # The environment variables. More details here
163   LABEL: { name string: value string, ... } # The metadata to an image. More details here
164   EXPOSE: [ string, ... ] # To inform Docker that the container listens on the specified network ports at runtime. More details here
165   ENTRYPOINT: string | [ string, ... ] # To configure a container that will run as an executable. Shell and exec forms are supported. More details here
166   CMD: string | [ string, ... ] # To provide default arguments for the ENTRYPOINT to configure a container that will run as an executable. Shell and exec forms are supported. More details here
167   HEALTHCHECK: string # To tell Docker how to test a container to check that it is still working. More details here
168 mount: # Mount points. More details here
...
169 - from: tmp_dir || build_dir # Service folder name
170   fromPath: string # Absolute or relative path to an arbitrary file or folder on host
171   to: string # Absolute path in image
172 import: # Imports. More details here
...
173 - artifact: string # The artifact name from which you want to copy files (DEPRECATED)
174   image: string # The image name from which you want to copy files
175   stage: string # The stage name from which you want to copy files (the latest one by default)
176   before: string # The stage name before which to perform importing files. At present, only install and setup stages are supported
177   after: string # The stage name after which to perform importing files. At present, only install and setup stages are supported
178   add: string # The absolute file or folder path in source image for copying
179   to: string # The absolute path in destination image. In case of absence, destination path equals source path
180   owner: string # The name or UID of the owner
181   group: string # The name or GID of the owner’s group
182   includePaths: [ glob, ... ] # Globs for including
183   excludePaths: [ glob, ... ] # Globs for excluding
184 dependencies: # Dependencies images for current image
...
185 - image: string # Dependency image name, which should be built before building current image
186   before: string # The stage name before which image info should be imported (specify install or setup). Specified target env variables will be available at user stages after stage specified by this directive.
187   after: string # The stage name after which image info should be imported (specify install or setup). Specified target env variables will be available at user stages after stage specified by this directive.
188   imports: # Define target environment variables to import image information into current image (optional)
189   - type: string # Type of image info: ImageName, ImageDigest, ImageRepo or ImageTag
190     targetEnv: string # Name of environment variable which will contain specified type of information about image
cncf logo
werf is a Cloud Native Computing Foundation sandbox project
flant logo
werf was originally created by Flant
The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see Trademark Usage.
Site last generated: Jun 10, 2025 at 18:27 +0300