Closed johnstcn closed 27 minutes ago
As I was working on implementing tests for https://github.com/coder/kaniko/pull/17 to fix this issue, I noticed we have another issue with multi-stage builds. COPY directives in multi-stage builds (COPY --from=first /a /b
) rely on extraction to get the file hash. It makes sense but throws a few wrenches in our approach. Tracking the file hash across stages seems like a non-trivial thing to do. Without extraction, I think we'd still need to read the tar of the first
stage to figure out the hash of the file to be copied.
Currently, when attempting to
DoCacheProbe
fails when encounteringENV
directives:It looks like we need to implement the
CachedExecuteCommand
interface for bothENV
andARG
commands:To reproduce, here is a sample Dockerfile that fails to cache probe:
Alternatively, try to build the dogfood Dockerfile from coder/coder with
ENVBUILDER_GET_CACHED_IMAGE=1
(assuming the image was previously built).