Skip to content
BENIBIX Learn

Base Image

Infrastructure📦 ContainersImage Builds

Also known as Parent Image, FROM Image, scratch Image

The first image a build starts from. It is named on the FROM line.

Think of it like

Think of it like a plain pizza base. You add your own toppings on top.

Example

Lucy's build file starts FROM python:3.13-slim. Her image gets Python and a small Linux system, then her code goes on top.

Why it matters

Most of an image's size, and most of its security holes, come from the base. Picking a small, fresh one helps with both.

Definition

A base image is the image a Dockerfile starts from, named on its FROM line. It brings the starting files, often a small Linux system or a language such as Python. Your own steps add layers on top of it. A small base makes a smaller image with less to patch. The special name scratch means start from nothing at all.

Example code

dockerfile
FROM python:3.13-slim
COPY . /app
CMD ["python", "/app/main.py"]
The FROM line names the base image. The lines after it add layers on top.
The base image is the bottom of the stack. Every other layer is built on top of it.

Common mistake

Never rebuilding. The base gets security fixes, but an image built once keeps the old, unpatched files.

Key takeaways

  1. 1
    The FROM line. Names where the image starts.
  2. 2
    Most of the size. And most of the files to patch.
  3. 3
    Scratch is empty. Start from nothing at all.