A Dockerfile describes how to construct an image from a base and a build context. COPY reads from that context, not from any arbitrary host path. A build cache reuses the result of an instruction when its relevant inputs still match. Changing an earlier layer invalidates later dependent layers. A tag is a reference to an image. Creating another local tag doesn't upload bytes or make that reference available to another machine.
Apply those boundaries to fresh fixtures. Inspect the requested name, namespace, path and value before reusing a command. The tasks mix earlier operations and include nearby wrong targets, so preserve unrelated work. Choose any supported approach that produces the complete requested state; the checker evaluates the result rather than a recorded command sequence.