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






