A Dockerfile is a text file containing instructions that Docker performs to build a container image. It packages an application and its dependencies so the resulting image can run locally or with Kubernetes. section 2.2.2 section 2.4
A minimal Dockerfile typically establishes the image foundation, adds application files, and defines the startup command:
- FROM selects the base image; here, node:23-alpine supplies the Node.js runtime. section 2.2.2
- COPY transfers app.js and the html directory from the local build context into the image. section 2.2.2
- ENTRYPOINT defines the command Docker runs when the container starts: node app.js. 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
Use the minimal Dockerfile listing to see how base-image selection, file copying, and startup behavior fit together. section 2.2.2
Build an image from a Dockerfile
With the Dockerfile, app.js, and html directory in the current directory, run docker build -t kiada:latest .. Docker resolves the node:23-alpine base image, executes the COPY instructions, exports image layers, and names the result kiada:latest. docker images lists the image, while docker history shows the instructions and layers that produced it. section 2.2.2 section 2.2.2

















