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 fromCOPY- copy files into the imageRUN- execute commands during buildCMD- command to run when container starts
Build the image:
$ docker build -t myapp:latest .