Why this matters
Centralization prevents configuration drift and makes upgrades a single-point change.
Parameterize tool/runtime versions via ARGs (and CI build args) instead of hardcoding them across multiple Dockerfiles.
Centralization prevents configuration drift and makes upgrades a single-point change.
Side-by-side examples engineers can pattern-match during review.
FROM node:20.11.1-alpine
ENV YARN_VERSION=4.1.0
RUN corepack enable && corepack prepare yarn@4.1.0 --activateARG NODE_VERSION=20.11.1
FROM node:${NODE_VERSION}-alpine
ARG YARN_VERSION
RUN corepack enable && corepack prepare yarn@${YARN_VERSION} --activateENV PNPM_VERSION=8.15.0 # repeated in many filesARG PNPM_VERSION
RUN corepack prepare pnpm@${PNPM_VERSION} --activateFrom the same buckets as this rule.