Skip to content

Commit 2d14b6a

Browse files
authored
Merge pull request #18 from mzihlmann/warn-about-cache-misses
RUN commands dont specify which files were added
2 parents 8b37861 + b058214 commit 2d14b6a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/executor/build.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ func (s *stageBuilder) build() error {
437437
// Raise Warnings for commands that are uncacheable
438438
switch command.(type) {
439439
case *commands.RunCommand:
440-
if len(files) == 0 {
440+
fi, err := os.Stat(tarPath)
441+
if err == nil && fi.Size() <= emptyTarSize {
441442
logrus.Warn("cache-violation: RUN created an empty layer, this will cause a diff when rebuilding from cache for the first time.")
442443
}
443444
case *commands.WorkdirCommand:

0 commit comments

Comments
 (0)