Skip to content

Commit

Permalink
fix: allow empty run layers to be pushed without force build meta
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mafredri committed Nov 7, 2024
1 parent 350cbb8 commit 8aeb946
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/executor/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,11 @@ func (s *stageBuilder) takeSnapshot(files []string, shdDelete bool) (string, err
} else {
// Volumes are very weird. They get snapshotted in the next command.
files = append(files, util.Volumes()...)
snapshot, err = s.snapshotter.TakeSnapshot(files, shdDelete, s.opts.ForceBuildMetadata)
forceBuildMetadata := s.opts.ForceBuildMetadata
if s.opts.Cache && len(s.opts.Destinations) > 0 && !s.opts.NoPush {
forceBuildMetadata = true
}
snapshot, err = s.snapshotter.TakeSnapshot(files, shdDelete, forceBuildMetadata)
}
timing.DefaultRun.Stop(t)
return snapshot, err
Expand Down

0 comments on commit 8aeb946

Please sign in to comment.