Dockerfile
ELI5 — The Vibe Check
A Dockerfile is the recipe for building a Docker image. It's a text file with step-by-step instructions: start from this base OS, install these tools, copy in my code, run this command to start. Docker reads the recipe and bakes your image. Change the recipe, get a different image.
Real Talk
A Dockerfile is a text file containing sequential instructions for building a container image. Each instruction creates a new immutable layer. Common instructions include FROM (base image), RUN (execute commands), COPY (add files), ENV (set env vars), and CMD/ENTRYPOINT (define startup command).
Show Me The Code
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["node", "dist/index.js"]
When You'll Hear This
"Write a Dockerfile so the app can run in any cloud environment." / "The Dockerfile is missing a COPY step — that's why the build is failing."
Related Terms
Build
A build is the process of turning your development code into something a real computer or browser can run efficiently.
Container
A container is a running instance of a Docker image — it's the lunchbox you made and actually opened to eat from.
Docker
Docker is like a lunchbox for your app.
Image
A Docker image is the blueprint or template for a container. It's like a frozen snapshot of your app and everything it needs to run.