Docker Course
Docker
/
Beginner

FROM

Definition

The instruction that initializes a new build stage and sets the Base Image for subsequent instructions. It is the mandatory first instruction in a valid Dockerfile.

Explain Like I'm New

Choosing your starting canvas. You can't build something out of nothing. You must tell Docker what operating system to start with.

Real World Example

`FROM ubuntu:22.04` starts with a pure Linux environment. `FROM python:3.9` starts with Linux but saves you time by already having Python pre-installed.

Common Use Cases

  • •Defining environments
  • •Image inheritence

Interview Questions

basic

  • Can you have a Dockerfile without a `FROM` statement?

Flash Cards

Question

No FROM?

Click to reveal answer
Answer

No. Every single Dockerfile must begin with a `FROM` statement.