Skip to content

Commit

Permalink
docs(multiarch): complete platform settings docs
Browse files Browse the repository at this point in the history
* added per image platform setting into build usage;
* added all possible platform settings into werf.yaml reference.

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed May 16, 2023
1 parent bc4ef3d commit a9431b7
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
22 changes: 22 additions & 0 deletions docs/_data/werf_yaml.yml
Expand Up @@ -16,6 +16,18 @@ sections:
en: Config syntax version. It should always be 1 for now
ru: Версия конфигурации. На данный момент поддерживается единственная версия 1
required: true
- name: build
description:
en: Common build settings
ru: Общие настройки сборки
collapsible: true
isCollapsedByDefault: false
direcvies:
- name: platform
description:
en: Common list of target platforms for all images (for example ['linux/amd64', 'linux/arm64', 'linux/arm/v8'])
ru: Общий список целевых платформ для всех образов (например ['linux/amd64', 'linux/arm64', 'linux/arm/v8'])
value: "[ string, ... ]"
- name: deploy
description:
en: Settings for deployment
Expand Down Expand Up @@ -192,6 +204,11 @@ sections:
description:
en: Build context PATH inside project directory
ru: Путь к контексту внутри папки проекта
- name: platform
description:
en: List of target platforms for this image (for example ['linux/amd64', 'linux/arm64', 'linux/arm/v8'])
ru: Список целевых платформ для данного образа (например ['linux/amd64', 'linux/arm64', 'linux/arm/v8'])
value: "[ string, ... ]"
- name: contextAddFiles
value: "[ string, ... ]"
description:
Expand Down Expand Up @@ -266,6 +283,11 @@ sections:
ru: Уникальное имя артефакта
detailsArticle:
all: "/usage/build/stapel/imports.html"
- name: platform
description:
en: List of target platforms for this image (for example ['linux/amd64', 'linux/arm64', 'linux/arm/v8'])
ru: Список целевых платформ для данного образа (например ['linux/amd64', 'linux/arm64', 'linux/arm/v8'])
value: "[ string, ... ]"
- name: from
value: "string"
description:
Expand Down
20 changes: 19 additions & 1 deletion docs/pages_en/usage/build/images.md
Expand Up @@ -405,7 +405,7 @@ In this case, running the `werf build` command without parameters will start the

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).

Here is how you can define a list of target platforms:
Here is how you can define a common list of target platforms for all images in the werf.yaml:

```yaml
# werf.yaml
Expand All @@ -418,8 +418,26 @@ build:
- linux/arm/v7
```

It is possible to define list of target platforms separately per image in the werf.yaml (this setting will have a priority over common list of target platforms):

```yaml
# werf.yaml
image: mysql
dockerfile: ./Dockerfile.mysql
platform:
- linux/amd64
---
image: backend
dockerfile: ./Dockerfile.backend
platform:
- linux/amd64
- linux/arm64
```

You can also override this list using the `--platform` parameter as follows:

```shell
werf build --platform=linux/amd64,linux/i386
```

— this parameter will override all platform settings specified in the werf.yaml (both common list and per-image list).
22 changes: 20 additions & 2 deletions docs/pages_ru/usage/build/images.md
Expand Up @@ -405,7 +405,7 @@ dockerfile: backend/Dockerfile

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

Можно определить список платформ с помощью конфигурации:
Можно определить общий список платформ для всех образов в werf.yaml с помощью конфигурации:

```yaml
# werf.yaml
Expand All @@ -418,8 +418,26 @@ build:
- linux/arm/v7
```

Список можно также переопределить параметром `--platform` непосредственно в момент вызова сборки:
Можно определить список целевых платформ отдельно для каждого собираемого образа (такая настройка будет иметь приоритет над общим списком определённым в werf.yaml):

```yaml
# werf.yaml
image: mysql
dockerfile: ./Dockerfile.mysql
platform:
- linux/amd64
---
image: backend
dockerfile: ./Dockerfile.backend
platform:
- linux/amd64
- linux/arm64
```

Общий список можно также переопределить параметром `--platform` непосредственно в момент вызова сборки:

```shell
werf build --platform=linux/amd64,linux/i386
```

— такой параметр переопределяет список целевых платформ указанных в werf.yaml (как общих, так и для отдельных образов).

0 comments on commit a9431b7

Please sign in to comment.