Replace ADD with COPY

Apache 2.0

Replaces ADD instructions with COPY where appropriate. ADD is only kept when the source is a URL or a tar archive that should be auto-extracted. Using COPY is preferred for transparency (CIS Docker Benchmark 4.9).

org.openrewrite.docker.ReplaceAddWithCopy
mod run . --recipe=org.openrewrite.docker.ReplaceAddWithCopy

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.