From 58f4dbc39070e67abbf7783966141d79e373b87a Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Fri, 12 Jul 2019 16:00:57 -0700 Subject: [PATCH] docs: document from platform Signed-off-by: Tonis Tiigi Co-Authored-By: Tibor Vass --- docs/reference/builder.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/reference/builder.md b/docs/reference/builder.md index 6b55151fb7cc..76da88e4f3bb 100644 --- a/docs/reference/builder.md +++ b/docs/reference/builder.md @@ -558,15 +558,15 @@ the first pattern, followed by one or more `!` exception patterns. ## FROM - FROM [AS ] + FROM [--platform=] [AS ] Or - FROM [:] [AS ] + FROM [--platform=] [:] [AS ] Or - FROM [@] [AS ] + FROM [--platform=] [@] [AS ] The `FROM` instruction initializes a new build stage and sets the [*Base Image*](glossary.md#base-image) for subsequent instructions. As such, a @@ -591,6 +591,14 @@ the [*Public Repositories*](https://docs.docker.com/engine/tutorials/dockerrepos builder assumes a `latest` tag by default. The builder returns an error if it cannot find the `tag` value. +Optional flag `--platform` can be used to specify the platform of the image in +case the reference points to a multi-platform image. For example `linux/amd64`, +`linux/arm64`, `windows/amd64`. By default, the target platform of the build request +is used. Global build arguments can be used in the value of this flag, for example +[automatic platform ARGs](#automatic-platform-args-in-the-global-scope) allow to +force a stage to native build platform (`--platform=$BUILDPLATFORM`) and use it +to cross compile to the target platform inside the stage. + ### Understand how ARG and FROM interact `FROM` instructions support variables that are declared by any `ARG`