1. how many stages there are
2. how long they are
3. the dependencies
Taking the example from the article:
FROM node:18-alpine as builder
WORKDIR /app
COPY ./package* .
RUN npm ci
COPY . .
RUN npm run build:client
FROM nginxinc/nginx-unprivileged:1.24 as serve
COPY --from=builder /app/dist /var/www
COPY --from=builder /app/.nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
IMHO it's just so more legible. Without this, it feels like writing C without indentation. Unfortunately the Jetbrains IDEs fail to properly apply syntax highlighting.