arrow_back
Back

Dockerfile FROM: base images, tags, and multi-stage builds

Andrew Dorokhov Andrew Dorokhov schedule 1 min read

FROM - initializes a new build stage and sets the base image.

The FROM instruction defines the base OS image. The FROM instruction is strictly mandatory for all Dockerfiles as the very first uncommented instruction.

It specifies the base image for the Dockerfile. All subsequent instructions perform build operations on top of the specified image. The base image is defined in the form IMAGE:TAG (e.g., debian:wheezy). If the tag is not specified, it defaults to latest, but I strongly recommend always explicitly specifying the version tag to avoid unpleasant surprises. This instruction must be the very first in the Dockerfile.

open_in_new Official docs on the FROM instruction .

code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward