Skip to content

Commit

Permalink
docs(multiarch): refine multiarch titles and host preparation info
Browse files Browse the repository at this point in the history
Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed May 4, 2023
1 parent 3a60ff5 commit b1f78c1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
18 changes: 12 additions & 6 deletions docs/pages_en/usage/build/images.md
Expand Up @@ -230,7 +230,9 @@ import:

For more info on how to write Stapel instructions refer to the [documentation]({{"usage/build/stapel/base.html" | true_relative_url }}).

## Inheriting images and importing files
## Linking images

### Inheritance and importing files

A multi-stage mechanism allows you to define a separate image stage in a Dockerfile and use it as a basis for another image or copy individual files from it.

Expand Down Expand Up @@ -298,7 +300,7 @@ COPY --from=${BUILDER_IMAGE} /app/bin /app/bin
CMD [ "/app/bin/server", "server" ]
```

## Passing information about the built image to another image
### Passing information about the built image to another image

werf allows you to get information about the built image when building another image. Suppose, the build instructions of the `app` image require the names and digests of the `auth` and `controlplane` images published in the container registry. The configuration in this case would look like this:

Expand Down Expand Up @@ -364,7 +366,13 @@ dependencies:

During the build, werf will automatically insert the appropriate names and identifiers into the referenced build-arguments. werf will take care of all orchestration and dependency mapping and then build everything in one step (as part of the `werf build` command).

## Building for the target platform
## Multi-platform and cross-platform building

werf can build images for either the native host platform where werf have started, or for arbitrary platform in cross-platform mode using emulation. Also it is possible to build images for multiple platforms at the same time (i.e. manifest-list images).

> **NOTE:** Refer to the [Installation]({{ "index.html" | true_relative_url }}) for more information about preparing host system for cross-platform builds, and [Build process]({{ "/usage/build/process.html" | true_relative_url }}) for more information on multi-platform support for different syntaxes and backends.
### Building for single target platform

The user can choose the target platform for the images to be built using the `--platform` parameter:

Expand Down Expand Up @@ -393,9 +401,7 @@ dockerfile: backend/Dockerfile

In this case, running the `werf build` command without parameters will start the image build process for the specified platform (the explicitly passed `--platform` parameter will override the werf.yaml settings).

> **NOTE:** Refer to the [Build process]({{ "/usage/build/process.html" | true_relative_url }}) article for more information on multi-platform support for different syntaxes and backends, as well as on how to prepaare a host system for multi-platform builds.
### Building multiplatform images
### Building for multiple target platforms

werf supports simultaneous image building for multiple platforms. In this case, werf publishes a special manifest in the container registry, which includes the built images for each specified target platform (pulling such an image will provide the client with the image built for the client platform).

Expand Down
8 changes: 1 addition & 7 deletions docs/pages_en/usage/build/process.md
Expand Up @@ -306,13 +306,7 @@ werf converge --repo registry.mydomain.org/repo --synchronization :local
## Multiplatform builds

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:

```shell
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
```

[List of supported architectures](https://www.qemu.org/docs/master/about/emulation.html).
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. [List of supported architectures](https://www.qemu.org/docs/master/about/emulation.html). Refer to the [Installation]({{ "index.html" | true_relative_url }}) for more information about preparing host system for cross-platform builds.

The table below summarizes support of multiplatform building for different configuration syntaxes, building modes, and build backends:

Expand Down
20 changes: 13 additions & 7 deletions docs/pages_ru/usage/build/images.md
Expand Up @@ -230,7 +230,9 @@ import:

Подробная документация по написанию доступна [в разделе stapel]({{ "usage/build/stapel/base.html" | true_relative_url }}).

## Наследование образов и импортирование файлов
## Взаимодействие между образами

### Наследование и импортирование файлов

При написании одного Dockerfile в нашем распоряжении имеется механизм multi-stage. Он позволяет объявить в Dockerfile отдельный образ-стадию и использовать её в качестве базового для другого образа, либо скопировать из неё отдельные файлы.

Expand Down Expand Up @@ -298,7 +300,7 @@ COPY --from=${BUILDER_IMAGE} /app/bin /app/bin
CMD [ "/app/bin/server", "server" ]
```

## Передача информации о собранном образе в другой образ
### Передача информации о собранном образе в другой образ

werf позволяет получить информацию о собранном образе при сборке другого образа. Например, если в сборочных инструкциях образа `app` требуются имена и digest'ы образов `auth` и `controlplane`, опубликованных в container registry, то конфигурация могла бы выглядеть так:

Expand Down Expand Up @@ -364,9 +366,15 @@ dependencies:

В процессе сборки werf автоматически подставит в указанные build-arguments соответствующие имена и идентификаторы. Всю оркестрацию и выстраивание зависимостей werf возьмёт на себя и произведёт сборку за один шаг (вызов `werf build`).

## Сборка образов под произвольную платформу
## Мультиплатформенная и кроссплатформенная сборка

werf позволяет собирать образы как для родной архитектуры хоста, где запущен werf, так и в кроссплатформенном режиме с помощью эмуляции целевой архитектуры, которая может быть отлична от архитектуры хоста. Также werf позволяет собрать образ сразу для множества целевых платформ.

> **ЗАМЕЧАНИЕ:** Подготовка хост-системы для мультиплатформенной сборки рассмотрена [в разделе установки werf]({{ "index.html" | true_relative_url }}), а поддержка этого режима для различных синтаксисов инструкций и бекендов рассмотрены [в разделе про сборочный процесс]({{ "/usage/build/process.html" | true_relative_url }}).
При сборке можно выбрать целевую платформу для собираемых образов с помощью параметра `--platform`:
### Сборка образов под одну целевую платформу

По умолчанию в качестве целевой используется платформа хоста, где запущен werf. Выбор другой целевой платформы для собираемых образов осуществляется с помощью параметра `--platform`:

```shell
werf build --platform linux/arm64
Expand All @@ -393,9 +401,7 @@ dockerfile: backend/Dockerfile

В этом случае запуск `werf build` без параметров вызовет сборку образов для указанной платформы (при этом явно указанный параметр `--platform` переопределяет значение из werf.yaml).

> **ЗАМЕЧАНИЕ:** Подготовка хост-системы для мультиплатформенной сборки и поддержка этого режима для различных синтаксисов инструкций и бекендов рассмотрены [в разделе про сборочный процесс]({{ "/usage/build/process.html" | true_relative_url }}).
### Сборка мультиплатформенных образов
### Сборка образов под множество целевых платформ

Поддерживается и сборка образов сразу для набора архитектур. В этом случае в container registry публикуется манифест включающий в себя собранные образы под каждую из указанных платформ (во время скачивания такого образа автоматически будет выбираться образ под требуемую архитектуру).

Expand Down
8 changes: 1 addition & 7 deletions docs/pages_ru/usage/build/process.md
Expand Up @@ -306,13 +306,7 @@ werf converge --repo registry.mydomain.org/repo --synchronization :local
## Мультиплатформенная сборка

Мультиплатформенная сборка использует механизмы кроссплатформенного исполнения инструкций, предоставляемые [ядром Linux](https://en.wikipedia.org/wiki/Binfmt_misc) и эмулятором QEMU. Самый простой способ зарегистрировать в хост-системе эмуляторы для большинства архитектур — воспользоваться образом `qemu-user-static`:

```shell
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
```

[Перечень поддерживаемых архитектур](https://www.qemu.org/docs/master/about/emulation.html).
Мультиплатформенная сборка использует механизмы кроссплатформенного исполнения инструкций, предоставляемые [ядром Linux](https://en.wikipedia.org/wiki/Binfmt_misc) и эмулятором QEMU. [Перечень поддерживаемых архитектур](https://www.qemu.org/docs/master/about/emulation.html). Подготовка хост-системы для мультиплатформенной сборки рассмотрена [в разделе установки werf]({{ "index.html" | true_relative_url }})

Поддержка мультиплатформенной сборки для разных вариантов синтаксиса сборки, режимов сборки и используемого бекенда:

Expand Down

0 comments on commit b1f78c1

Please sign in to comment.