|
@@ -349,9 +349,16 @@ func dispatchRun(ctx context.Context, d dispatchRequest, c *instructions.RunComm
|
|
|
saveCmd = prependEnvOnCmd(d.state.buildArgs, buildArgs, cmdFromArgs)
|
|
|
}
|
|
|
|
|
|
+ cacheArgsEscaped := argsEscaped
|
|
|
+ // ArgsEscaped is not persisted in the committed image on Windows.
|
|
|
+ // Use the original from previous build steps for cache probing.
|
|
|
+ if d.state.operatingSystem == "windows" {
|
|
|
+ cacheArgsEscaped = stateRunConfig.ArgsEscaped
|
|
|
+ }
|
|
|
+
|
|
|
runConfigForCacheProbe := copyRunConfig(stateRunConfig,
|
|
|
withCmd(saveCmd),
|
|
|
- withArgsEscaped(argsEscaped),
|
|
|
+ withArgsEscaped(cacheArgsEscaped),
|
|
|
withEntrypointOverride(saveCmd, nil))
|
|
|
if hit, err := d.builder.probeCache(d.state, runConfigForCacheProbe); err != nil || hit {
|
|
|
return err
|