mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 18:58:32 +02:00
Add CacheCommand to DockerCommand interface
CacheCommand returns true if the command should be cached. Currently, it's only true for RUN but can be added to ADD/COPY later on (these are different since the contents of files for ADD/COPY need to be included in the cache key generation). I also changed CreatedBy to String so that we can log each command before cache extraction or regular execution takes place.
This commit is contained in:
@@ -85,6 +85,7 @@ func DoBuild(opts *options.KanikoOptions) (v1.Image, error) {
|
||||
if dockerCommand == nil {
|
||||
continue
|
||||
}
|
||||
logrus.Info(dockerCommand.String())
|
||||
if err := dockerCommand.ExecuteCommand(&imageConfig.Config, buildArgs); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -138,7 +139,7 @@ func DoBuild(opts *options.KanikoOptions) (v1.Image, error) {
|
||||
Layer: layer,
|
||||
History: v1.History{
|
||||
Author: constants.Author,
|
||||
CreatedBy: dockerCommand.CreatedBy(),
|
||||
CreatedBy: dockerCommand.String(),
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user