low · dockerfile/add-instead-of-copy

ADD used instead of COPY

ADD has magic behavior (auto-extract, remote URLs). Prefer COPY unless you need that behavior.

Why it breaks the cache

Unexpected ADD behavior makes Dockerfiles harder to reason about.

Bad Dockerfile

ADD . /app/

Good Dockerfile

COPY . /app/

CLI

layerlint rules explain add-instead-of-copy

All docs · Download