CACHE [cached directories...]
The CACHE
instruction makes specific files/directories be shared across runs,
almost always as a performance improvement.
See the tuning performance documentation for more
details.
Examples
- Use
CACHE /var/cache/apt
to speed upRUN apt-get update
- Use
CACHE ~/.cache/go-build
to speed upRUN go install
- Use
CACHE ~/.npm ~/.next/cache ~/.yarn/cache
to speed upnpm install
andyarn install