liveBook · Manning

Base image

As explained in Kubernetes for Developers

A base image is a Docker image that provides the initial filesystem and runtime environment for building another application image.

A base image gives a new Docker image its initial filesystem and runtime environment. Instead of configuring a generic Ubuntu container from zero, start with an image such as Python, Ruby, or httpd that already supplies the relevant environment. section 2.1.4

A base image is itself built with a Dockerfile and may inherit from another base image. This chain can continue until scratch, an empty starting container. Choose the image that eliminates the most configuration, then add application dependencies, copy the application, and define how it runs. section 2.1.4 section 2.2.1

Choose a base image by considering the work it removes and the maintenance it creates:

  • Prefer a language or framework image when it matches the application: use python for Django, ruby for Rails, and a suitable server image for Apache. section 2.1.4 section 2.2.1
  • Search existing Dockerfile examples before building from scratch; public images and examples can provide a substantial starting point for common environments. section 2.1.4 section 2.2.1
  • Rebuild containers when base-image vulnerabilities are fixed, and select a version tag deliberately: a minor version can receive patches while reducing unexpected feature changes. section 12.1.2

Python application image

A small Python image can begin with FROM python:3, copy the application into /app, and set /app as the working directory. An HTTP server can use FROM python:3.12, add its application-specific settings, and run with Docker port forwarding.

How Kubernetes for Developers covers it

How deep it goes
Explains inheritance, practical selection, Dockerfile composition, compilation, and update policy, but stops short of exhaustive image internals.
Examples
Uses Python, Ruby, httpd, OpenJDK, a Python HTTP server, and a Java compilation Dockerfile as concrete examples.
What it assumes
Assumes basic Docker build and run commands while introducing image inheritance, language-specific images, Dockerfiles, and version tags through examples.
What you can do after
Build it from scratch by selecting a suitable image, adding dependencies and application files, defining execution, and rebuilding when fixes arrive.
How it connects
Connects base images with Dockerfiles, container images, application dependencies, compilation, port forwarding, vulnerability scanning, and multi-stage builds.

Also explained in

Compare how 7 books explain base image →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.