Skip to content

Commit 8aeb946

Browse files
committed
fix: allow empty run layers to be pushed without force build meta
Images of type application/vnd.docker.image.rootfs.diff.tar.gzip seem to break when you try to push metadata-only layers and the layers all share the same hash. This doesn't seem to be a problem with OCI images. Ref: coder/envbuilder#385
1 parent 350cbb8 commit 8aeb946

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/executor/build.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,11 @@ func (s *stageBuilder) takeSnapshot(files []string, shdDelete bool) (string, err
564564
} else {
565565
// Volumes are very weird. They get snapshotted in the next command.
566566
files = append(files, util.Volumes()...)
567-
snapshot, err = s.snapshotter.TakeSnapshot(files, shdDelete, s.opts.ForceBuildMetadata)
567+
forceBuildMetadata := s.opts.ForceBuildMetadata
568+
if s.opts.Cache && len(s.opts.Destinations) > 0 && !s.opts.NoPush {
569+
forceBuildMetadata = true
570+
}
571+
snapshot, err = s.snapshotter.TakeSnapshot(files, shdDelete, forceBuildMetadata)
568572
}
569573
timing.DefaultRun.Stop(t)
570574
return snapshot, err

0 commit comments

Comments
 (0)