Ram

Lesson 3 of 6

Dockerfile Basics

Describe how to build an application image.

Introduction

A Dockerfile contains ordered instructions used to build an image.

Common instructions include FROM, WORKDIR, COPY, RUN, EXPOSE and CMD.

Key insight

Describe how to build an application image.

Example

FROM node:22-alpine
WORKDIR /app
COPY . .
RUN npm ci
CMD ["npm", "start"]

Read the example line by line, then try changing one value.

Real-world example

Dockerfile Basics helps developers build useful applications.

Practice challenge

Identify which line chooses the base image.

Previous
Next