From 124b38ad6e6845d5bf041c203b6e7778bf314738 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 6 Jul 2022 14:59:18 +0900 Subject: [PATCH] build: add platforms Closes issue 120 Signed-off-by: Akihiro Suda --- build.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/build.md b/build.md index 7d7eb45a..f643552a 100644 --- a/build.md +++ b/build.md @@ -393,6 +393,41 @@ tags: - "registry/username/myrepos:my-other-tag" ``` +### platforms + +`platforms` defines a list of target [platforms](spec.md#platform). + +```yml +build: + context: . + platforms: + - "linux/amd64" + - "linux/arm64" +``` + +Compose implementations SHOULD include the native platform in the default target platform list. + +Compose implementations SHOULD report an error in the following cases: +* when the list contains multiple platforms but the implementation is incapable of storing multi-platform images +* when the list contains an unsupported platform +```yml +build: + context: . + platforms: + - "linux/amd64" + - "hurd/386" +``` +* when the list is non-empty and does not contain the service's platform +```yml +services: + frontend: + platform: linux/amd64 + build: + context: . + platforms: + - linux/arm64 +``` + ## Implementations * [docker-compose](https://docs.docker.com/compose)