liveBook · Manning

Base image

As explained in Kubernetes in Action, Second Edition

A base image is a container image selected as the starting point for building another container image.

A base image is the starting container image for a new image. It supplies software your application needs, avoiding unnecessary work when building from scratch. section 2.2.2

Starting with Node.js

A Node.js application can start from node:23-alpine. The Dockerfile then copies app.js and html/ into the image and defines node app.js as the startup command. section 2.2.2

Listing 2.1 A minimal Dockerfile for building a container image
FROM node:23-alpine      #1
COPY app.js /app.js       #2
COPY html/ /html      #3
ENTRYPOINT ["node", "app.js"]      #4

Inspect the minimal Dockerfile showing the FROM instruction, copied application files, and startup command. section 2.2.2

Choose a base image according to the runtime your application requires:

  • Use an image that already contains the required runtime, such as Node.js for a Node.js application. section 2.2.2
  • Alternatively, start with a Linux distribution such as Fedora or Ubuntu and install the runtime during the build. section 2.2.2
  • Follow an organization’s mandated base-image and build-time software policy when one exists. section 2.2.2

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains selection and Dockerfile use, but stops short of detailed image-layer internals.
Examples
Uses node:23-alpine with copied app.js and html/ files in a minimal Dockerfile.
What it assumes
Assumes Docker is installed and a Node.js application with its files is available.
What you can do after
Builds a container image by selecting a runtime base and writing a Dockerfile FROM instruction.
How it connects
Connects base images with Dockerfiles, container images, Node.js, Linux distributions, and image layers.

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 in Action, Second Edition. The section links point to the parts of the book it draws on.