You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(build): add build.cacheVersion and <image>.cacheVersion directives (#6643)
Signed-off-by: Alexandr Zaytsev <alexandr.zaytsev@flant.com>
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
Co-authored-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
Copy file name to clipboardexpand all lines: docs/pages_en/usage/build/process.md
+26
Original file line number
Diff line number
Diff line change
@@ -152,6 +152,32 @@ There are several generations of the staged dockerfile builder. You can switch b
152
152
153
153
Stapel images are cached layer-by-layer in the container registry by default and do not require any configuration.
154
154
155
+
### Cache versioning
156
+
157
+
You can use the global directive `build.cacheVersion` or its local alternative `<image>.cacheVersion` to explicitly manage the cache version of images through configuration and ensure reproducibility of all previous builds. If both directives are specified, the local one takes precedence.
Copy file name to clipboardexpand all lines: docs/pages_ru/usage/build/process.md
+27
Original file line number
Diff line number
Diff line change
@@ -150,6 +150,33 @@ staged: true
150
150
151
151
Образы stapel кешируются в режиме послойного кеширования в container registry по умолчанию без дополнительной конфигурации.
152
152
153
+
### Версионирование кеша
154
+
155
+
Вы можете использовать глобальную директиву `build.cacheVersion` или её локальный аналог `<image>.cacheVersion`,
156
+
чтобы явно управлять версией кеша образов через конфигурацию и сохранять воспроизводимость всех сборок. Если обе директивы указаны, локальная имеет приоритет.
157
+
158
+
**Пример использования:**
159
+
160
+
```yaml
161
+
project: test
162
+
configVersion: 1
163
+
build:
164
+
cacheVersion: global-cache-version
165
+
---
166
+
image: backend
167
+
cacheVersion: user-cache-version
168
+
dockerfile: Dockerfile
169
+
---
170
+
image: frontend
171
+
cacheVersion: frontend-cache-version
172
+
dockerfile: Dockerfile
173
+
staged: true
174
+
---
175
+
image: user
176
+
cacheVersion: user-cache-version
177
+
from: alpine:3.14
178
+
```
179
+
153
180
## Параллельность и порядок сборки образов
154
181
155
182
<!-- прим. для перевода: на основе https://werf.io/docs/v2/internals/build_process.html#parallel-build -->
0 commit comments