docs icon indicating copy to clipboard operation
docs copied to clipboard

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

Open wreulicke opened this issue 4 months ago • 0 comments

Is this a docs issue?

  • [x] 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>]

wreulicke avatar Aug 21 '25 00:08 wreulicke