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
werf supports Docker Server or Buildah as backend for building images. Buildah provides full containerization and layer-by-layer Dockerfile builds with caching of all intermediate layers into the container registry. Docker Server is currently the default backend.
312
-
313
-
> **NOTE:** The Buildah backend does not currently support storing images locally, only [storing images in the container registry](#layer-by-layer-image-caching) is supported.
314
-
315
-
### Docker
316
-
317
-
Docker Server is currently the default backend and no additional configuration is required.
318
-
319
-
### Buildah
320
-
321
-
> **NOTE:** Buildah is currently only available to Linux users and Windows users with the WSL2 subsystem enabled. For macOS, we suggest using a virtual machine to run werf in Buildah mode.
322
-
323
-
werf uses Buildah in rootless mode to build images without a Docker server. Buildah is built into the werf binary. You can find the host system requirements to run werf with the Buildah backend [in the installation instructions](/installation.html).
324
-
325
-
Buildah can be enabled by setting the `WERF_BUILDAH_MODE` environment variable to one of the options: `auto`, `native-chroot`, `native-rootless`. Most users only have to set `WERF_BUILDAH_MODE=auto` to enable Buildah mode.
326
-
327
-
#### Level of assembly isolation
328
-
329
-
By default, in `auto` mode, werf automatically sets the isolation level depending on the platform and environment.
330
-
331
-
2 types of assembly container isolation are supported:
332
-
1. Chroot is an option that does not use the container runtime; it can be enabled as follows: `WERF_BUILDAH_MODE=native-chroot`.
333
-
2. Rootless is an option involving container runtime (crun or runc or kata or runsc must be installed on the system); it can be enabled as follows: `WERF_BUILAH_MODE=native-rootless`.
334
-
335
-
#### Storage driver
336
-
337
-
werf supports the `overlay` or `vfs` storage driver:
338
-
339
-
* `overlay` allows you to use the OverlayFS filesystem. You can either use the Linux kernel's built-in support for OverlayFS (if available) or you can use the fuse-overlayfs implementation. This is the recommended default choice.
340
-
* `vfs` provides access to a virtual filesystem instead of OverlayFS. This file system is inferior in performance and requires a privileged container, so it is not recommended. However, it may be useful in some cases.
341
-
342
-
Generally, the default driver (`overlay`) is enough. The storage driver can be set using the `WERF_BUILDAH_STORAGE_DRIVER` environment variable.
343
-
344
-
#### Ulimits
345
-
346
-
By default, the Buildah mode in werf inherits system ulimits when the build containers are started. The user can override these parameters using the `WERF_BUILDAH_ULIMIT` environment variable.
347
-
348
-
The format of `WERF_BUILDAH_ULIMIT=type=softlimit[:hardlimit][,type=softlimit[:hardlimit],...]` is comma-separated limit values:
349
-
* "core": maximum core dump size (ulimit -c);
350
-
* "cpu": maximum CPU time (ulimit -t);
351
-
* "data": maximum size of a process's data segment (ulimit -d);
352
-
* "fsize": maximum size of new files (ulimit -f);
353
-
* "locks": maximum number of file locks (ulimit -x);
354
-
* "memlock": maximum amount of locked memory (ulimit -l);
355
-
* "msgqueue": maximum amount of data in message queues (ulimit -q);
* "nofile": maximum number of open files (ulimit -n);
358
-
* "nproc": maximum number of processes (ulimit -u);
359
-
* "rss": maximum size of a process's (ulimit -m);
360
-
* "rtprio": maximum real-time scheduling priority (ulimit -r);
361
-
* "rttime": maximum amount of real-time execution between blocking syscalls;
362
-
* "sigpending": maximum number of pending signals (ulimit -i);
363
-
* "stack": maximum stack size (ulimit -s).
364
-
365
-
### Multiplatform builds
307
+
## Multiplatform builds
366
308
367
309
Multiplatform builds use the cross-platform instruction execution mechanics provided by the [Linux kernel](https://en.wikipedia.org/wiki/Binfmt_misc) and the QEMU emulator. The easiest way to register emulators for most architectures on your host system is to use the `qemu-user-static` image:
> **ЗАМЕЧАНИЕ:** Данный способ подходит лишь в том случае, если в вашей CI/CD системе все запуски werf происходят с одного и того же раннера.
306
306
307
-
## Настройка сборочного бэкенда
308
-
309
-
<!-- прим. для перевода: на основе https://werf.io/documentation/v1.2/advanced/buildah_mode.html -->
310
-
311
-
werf поддерживает использование Docker-сервер или Buildah в качестве бекенда для сборки образов. Buildah обеспечивает полноценную работу в контейнерах и послойную сборку Dockerfile'ов с кешированием всех промежуточных слоёв в container registry. Docker-сервер на данный момент является бекэндом, используемым по умолчанию.
312
-
313
-
> **ЗАМЕЧАНИЕ:** Сборочный бекэнд Buildah на данный момент не поддерживает хранение образов локально, поддерживается только [хранение образов в container registry](#послойное-кэширование-образов).
314
-
315
-
### Docker
316
-
317
-
Docker-сервер на данный момент является бекэндом, используемым по умолчанию, и никакая дополнительная настройка не требуется.
318
-
319
-
### Buildah
320
-
321
-
> **ЗАМЕЧАНИЕ:** На данный момент Buildah доступен только для пользователей Linux и Windows с включённой подсистемой WSL2. Для пользователей macOS предлагается использование виртуальной машины для запуска werf в режиме Buildah.
322
-
323
-
Для сборки без Docker-сервера werf использует Buildah в rootless-режиме. Buildah встроен в бинарник werf. Требования к хост-системе для запуска werf с бэкендом Buildah можно найти [в инструкциях по установке](/installation.html).
324
-
325
-
Buildah включается установкой переменной окружения `WERF_BUILDAH_MODE` в один из вариантов: `auto`, `native-chroot`, `native-rootless`. Большинству пользователей для включения режима Buildah достаточно установить `WERF_BUILDAH_MODE=auto`.
326
-
327
-
#### Уровень изоляции сборки
328
-
329
-
По умолчанию в режиме `auto` werf автоматически выбирает уровень изоляции в зависимости от платформы и окружения.
1. Chroot — вариант без использования container runtime, включается переменной окружения `WERF_BUILDAH_MODE=native-chroot`.
333
-
2. Rootless — вариант с использованием container runtime (в системе должен быть установлен crun, или runc, или kata, или runsc), включается переменной окружения `WERF_BUILAH_MODE=native-rootless`.
334
-
335
-
#### Драйвер хранилища
336
-
337
-
werf может использовать драйвер хранилища `overlay` или `vfs`:
338
-
339
-
* `overlay` позволяет использовать файловую систему OverlayFS. Можно использовать либо встроенную в ядро Linux поддержку OverlayFS (если она доступна), либо реализацию fuse-overlayfs. Это рекомендуемый выбор по умолчанию.
340
-
* `vfs` обеспечивает доступ к виртуальной файловой системе вместо OverlayFS. Эта файловая система уступает по производительности и требует привилегированного контейнера, поэтому ее не рекомендуется использовать. Однако в некоторых случаях она может пригодиться.
341
-
342
-
Как правило, достаточно использовать драйвер по умолчанию (`overlay`). Драйвер хранилища можно задать с помощью переменной окружения `WERF_BUILDAH_STORAGE_DRIVER`.
343
-
344
-
#### Ulimits
345
-
346
-
По умолчанию Buildah-режим в werf наследует системные ulimits при запуске сборочных контейнеров. Пользователь может переопределить эти параметры с помощью переменной окружения `WERF_BUILDAH_ULIMIT`.
347
-
348
-
Формат `WERF_BUILDAH_ULIMIT=type=softlimit[:hardlimit][,type=softlimit[:hardlimit],...]` — конфигурация лимитов, указанные через запятую:
349
-
* "core": maximum core dump size (ulimit -c);
350
-
* "cpu": maximum CPU time (ulimit -t);
351
-
* "data": maximum size of a process's data segment (ulimit -d);
352
-
* "fsize": maximum size of new files (ulimit -f);
353
-
* "locks": maximum number of file locks (ulimit -x);
354
-
* "memlock": maximum amount of locked memory (ulimit -l);
355
-
* "msgqueue": maximum amount of data in message queues (ulimit -q);
* "nofile": maximum number of open files (ulimit -n);
358
-
* "nproc": maximum number of processes (ulimit -u);
359
-
* "rss": maximum size of a process's (ulimit -m);
360
-
* "rtprio": maximum real-time scheduling priority (ulimit -r);
361
-
* "rttime": maximum amount of real-time execution between blocking syscalls;
362
-
* "sigpending": maximum number of pending signals (ulimit -i);
363
-
* "stack": maximum stack size (ulimit -s).
364
-
365
-
### Мультиплатформенная сборка
307
+
## Мультиплатформенная сборка
366
308
367
309
Мультиплатформенная сборка использует механизмы кроссплатформенного исполнения инструкций, предоставляемые [ядром Linux](https://en.wikipedia.org/wiki/Binfmt_misc) и эмулятором QEMU. Самый простой способ зарегистрировать в хост-системе эмуляторы для большинства архитектур — воспользоваться образом `qemu-user-static`:
0 commit comments