how does docker use cache?
Docker uses cache when the following two rules are met.
when the docker command is not
ADD
or
COPY
, e.g.
RUN
given parent image in cache
look at next instruction
if there is any child image (derived from parents) with the
exact same instruction use
it as cache
For
ADD
and
COPY
command, compare checksum of each file with exsiting images, if checksum is different then cache is invalidated