Dockerfile Purpose
Question
What does a Dockerfile do?
Hint
A Dockerfile is a recipe for building images.
Explanation
A Dockerfile is a text file with instructions to build a Docker image. Each instruction is a layer: FROM (base image), RUN (execute commands), COPY/ADD (copy files), WORKDIR (set working directory), ENV (set env vars), EXPOSE (document ports), CMD/ENTRYPOINT (default command). Build with docker build -t name . The order matters — put changing instructions last for better caching. Multi-stage builds use multiple FROM to reduce final image size.
Related Resources
Related Lessons
- Dockerfile
Learn Dockerfile.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.