base image
What is base image?
base image: The image your Dockerfile starts FROM. Everything else is layered on top of it — e.g. node:22-alpine or scratch. The base image is the starting point of a Docker image, named in the FROM line. Everything in your Dockerfile is added on top of it. Examples are php:8.4-fpm-alpine, node:22-alpine or the empty scratch image.
Frequently asked questions about base image
How is base image used in practice?
It decides a lot: the operating system, which packages are available, the image size and how many known security issues you inherit. An Alpine-based image is small; a Debian-based one is larger but more compatible with some libraries.
What should you keep in mind with base image?
Pin the version tag, such as node:22.11-alpine, rather than latest. That way your build does not change underneath you. Rebuild regularly anyway, so you pick up security fixes in the base. Official images from Docker Hub or the language's own maintainers are usually the safest choice.
What does an example of base image look like?
FROM node:22-alpine At a glance
| Category | Docker |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |