Skip to content

FROM instruction accepts a stage as base image, but it not clear in the Dockerfile reference. #23285

@wreulicke

Description

@wreulicke

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

I can't find what I'm looking for

Description

This link is the page to describe the FROM instruction.
But, it is not clear to accept a stage in FROM instruction.

https://docs.docker.com/reference/dockerfile/#from

But, it can be seen in this document.
https://docs.docker.com/build/building/multi-stage/#use-a-previous-stage-as-a-new-stage
And also it works in my local

$ docker version
Client:
 Version:           28.1.1
 API version:       1.49
 Go version:        go1.23.8
 Git commit:        4eba377
 Built:             Fri Apr 18 09:49:45 2025
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.41.2 (191736)
 Engine:
  Version:          28.1.1
  API version:      1.49 (minimum version 1.24)
  Go version:       go1.23.8
  Git commit:       01f442b
  Built:            Fri Apr 18 09:52:08 2025
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.7.27
  GitCommit:        05044ec0a9a75232cad458027ca83437aae3f4da
 runc:
  Version:          1.2.5
  GitCommit:        v1.2.5-0-g59923ef
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

$ cat Dockerfile
FROM alpine:latest AS common-setup

RUN addgroup -g 1001 loc && adduser -D -G loc -u 1001 loc

USER 1001

FROM common-setup

Could you update the dockerfile reference?

Location

https://docs.docker.com/reference/dockerfile/#from

Suggestion

Add this line. But, I'm not sure about specifications and semantics of the FROM instruction.

[FROM](https://docs.docker.com/reference/dockerfile/#from) [--platform=<platform>] <stage> [AS <name>]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/buildRelates to Dockerfiles or docker build commandstatus/triageNeeds triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions