Rework cache key generation a bit. (#375)

* Rework cache key generation a bit.

Cache keys are now based on the previous commands, rather than the previous state
of the filesystem.

* Refactor command interface a bit, only cache the context for commands that use it.
This commit is contained in:
dlorenc
2018-10-03 16:16:12 -05:00
committed by GitHub
parent 919df3949b
commit 734ffe65ce
28 changed files with 169 additions and 163 deletions
+1 -10
View File
@@ -23,6 +23,7 @@ import (
)
type ShellCommand struct {
BaseCommand
cmd *instructions.ShellCommand
}
@@ -32,17 +33,7 @@ func (s *ShellCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.B
return nil
}
// FilesToSnapshot returns an empty array since this is a metadata command
func (s *ShellCommand) FilesToSnapshot() []string {
return []string{}
}
// String returns some information about the command for the image config history
func (s *ShellCommand) String() string {
return s.cmd.String()
}
// CacheCommand returns false since this command shouldn't be cached
func (s *ShellCommand) CacheCommand() bool {
return false
}