Docker Course
Docker
/
Intermediate

Base Images

Definition

An image that has no parent image, usually an operating system like Ubuntu or Alpine. It serves as the foundational starting point for building a custom Docker Image.

Explain Like I'm New

The blank canvas you start painting on. You can't just put Python code in an empty box; it needs an operating system to run on. The Base Image provides that foundational OS.

Real World Example

Almost every Dockerfile starts with the word `FROM`. For example, `FROM node:18-alpine`. This tells Docker to download a pre-configured version of Linux that already has Node installed, and use that as the foundation to build your app upon.

Common Use Cases

  • •Dockerfile creation
  • •Security hardening

Interview Questions

basic

  • What keyword is always used at the very top of a Dockerfile to define the Base Image?

intermediate

  • What is the `scratch` base image used for?

Flash Cards

Question

Which keyword?

Click to reveal answer
Answer

`FROM`

Question

What is 'scratch'?

Click to reveal answer
Answer

`FROM scratch` is a completely, 100% empty image (0 bytes). It is usually only used by languages like Go or Rust that compile into standalone binary files and don't need a full operating system to run.