Skip to content

Commit 879fdda

Browse files
committed
engine: try fix to error applying docker zstd layers
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
1 parent 7c9f5d2 commit 879fdda

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

cmd/engine/main.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ import (
1515
"strings"
1616
"time"
1717

18+
"github.com/containerd/containerd/diff"
1819
"github.com/containerd/containerd/pkg/seed" //nolint:staticcheck // SA1019 deprecated
1920
"github.com/containerd/containerd/pkg/userns"
2021
"github.com/containerd/containerd/platforms"
2122
"github.com/containerd/containerd/remotes/docker"
2223
"github.com/containerd/containerd/sys"
24+
"github.com/containerd/typeurl/v2"
2325
sddaemon "github.com/coreos/go-systemd/v22/daemon"
2426
"github.com/dagger/dagger/engine/cache"
2527
"github.com/dagger/dagger/internal/engine"
@@ -92,6 +94,16 @@ func init() {
9294

9395
// enable in memory recording for buildkitd traces
9496
detect.Recorder = detect.NewTraceRecorder()
97+
98+
// TODO:(sipsma) upstream this if it works
99+
diff.RegisterProcessor(func(ctx context.Context, mediaType string) (diff.StreamProcessorInit, bool) {
100+
if mediaType != "application/vnd.docker.image.rootfs.diff.tar.zstd" {
101+
return nil, false
102+
}
103+
return func(ctx context.Context, stream diff.StreamProcessor, payloads map[string]typeurl.Any) (diff.StreamProcessor, error) {
104+
return diff.NewProcessorChain(ocispecs.MediaTypeImageLayer+"+zstd", stream), nil
105+
}, true
106+
})
95107
}
96108

97109
var propagators = propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})

0 commit comments

Comments
 (0)