# Base Image

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

**Field:** Infrastructure  
**Category:** Containers  
**Also known as:** Parent Image, FROM Image, scratch Image

## Think of it like

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

## 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

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.

## 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.

## 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.

## Common mistake

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

## Three principles

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

## Related terms

- [Container Image](https://learn.benibix.com/term/infrastructure/container-image)
- [Dockerfile](https://learn.benibix.com/term/infrastructure/dockerfile)
- [Image Layer](https://learn.benibix.com/term/infrastructure/image-layer)
- [Image Tag](https://learn.benibix.com/term/infrastructure/image-tag)
- [Multi-Stage Build](https://learn.benibix.com/term/infrastructure/multi-stage-build)

![A stack of four layers. At the bottom the base image from the FROM line, then a layer of installed packages, then a layer of app code. A thin dashed writable layer sits on top for a running container. A label reading myapp:1.2 points at the stack.](https://learn.benibix.com/diagrams/inf4-image-layers.svg)

---

Source: https://learn.benibix.com/term/infrastructure/base-image
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
