Skip to main content
In Docker, every custom image starts “FROM” another image—its parent. Tracing this chain leads to the special scratch image, the true base for all builds.
A base image is the origin of an image chain (often scratch), while a parent image is the one directly referenced by your FROM instruction.

1. Custom Web Application Image

Create a minimal Apache-based web server by extending the official HTTPD image:
  • Parent image: httpd
  • Your COPY command layers application files on top of the Apache HTTPD server.

2. Inside the HTTPD Official Image

The official HTTPD image itself builds on Debian:
  • Parent image: debian:buster-slim
  • Installs Apache HTTPD on a minimal Debian base.

3. Exploring the Debian Base Image

The Debian “slim” image originates from scratch:
  • Base image: scratch
  • Unpacks a minimal Debian filesystem from a tarball.
You cannot push or pull the scratch image—it’s only referenced in FROM scratch directives.

Table: Image Lineage at a Glance

4. Additional Official Image Chains

Ubuntu → MongoDB

  1. Ubuntu minimal from scratch:
  2. MongoDB on Ubuntu:

WordPress → PHP → Debian

The official WordPress image builds on the official PHP image, which in turn uses Debian—demonstrating another scratch → Debian → PHP → WordPress chain.
The image illustrates a comparison between base and parent images, showing different software stacks built on top of base images like Debian and Ubuntu, leading to applications like WordPress, MongoDB, and a custom web app.

5. The scratch Image: Docker’s True Base

  • scratch is Docker’s reserved, empty image.
  • It marks the very beginning of any build.
  • By adding a minimal OS filesystem on top of scratch, maintainers create base images (Debian, Alpine, Ubuntu), which then serve as parents for application and service images.
For more details on building and using base images, see the official Docker documentation on base images.

Watch Video