- Definition: A text file with instructions to build a Docker image.
- Instructions:
FROM
: Base image to use.
RUN
: Commands to execute in the image.
COPY
: Files to copy from the host to the image.
CMD
: Default command to run when the container starts.
- Example: A Dockerfile specifying a Node.js base image, installing dependencies, and copying code.