Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions docs/reference/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,15 +558,15 @@ the first pattern, followed by one or more `!` exception patterns.

## FROM

FROM <image> [AS <name>]
FROM [--platform=<platform>] <image> [AS <name>]

Or

FROM <image>[:<tag>] [AS <name>]
FROM [--platform=<platform>] <image>[:<tag>] [AS <name>]

Or

FROM <image>[@<digest>] [AS <name>]
FROM [--platform=<platform>] <image>[@<digest>] [AS <name>]

The `FROM` instruction initializes a new build stage and sets the
[*Base Image*](glossary.md#base-image) for subsequent instructions. As such, a
Expand All @@ -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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Optional flag `--platform` can be used to specify the platform of the image in
The 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`
Expand Down