high · dockerfile/manifest-without-lockfile

Dependency install without lockfile

Installing dependencies without copying the lockfile defeats reproducible builds.

Why it breaks the cache

Without a lockfile, installs can resolve different versions between builds.

Bad Dockerfile

COPY package.json ./
RUN npm ci

Good Dockerfile

COPY package.json package-lock.json ./
RUN npm ci

CLI

layerlint rules explain manifest-without-lockfile

All docs · Download