LOGBOOK

HELP

Quiz Entry - updated: 2026.06.20

What is a Dockerfile and how do you create a Docker image?

A Dockerfile is a text recipe of instructions — starting from a base image — that docker build runs to produce a container image.

FROM node:24.0.2-alpine3.20

COPY src/ ./
RUN npm install
CMD [ "node", "server.js" ]

Key instructions:

  • FROM - base image to start from
  • COPY - copy files into the image
  • RUN - execute commands during build
  • CMD - command to run when container starts

Build the image:

$ docker build -t myapp:latest .

From Quiz: WEBT / Advanced Topics | Updated: Jun 20, 2026