diff --git a/docs/nydus.md b/docs/nydus.md index 04a35c5dd61e2..e47fe7b3cb650 100644 --- a/docs/nydus.md +++ b/docs/nydus.md @@ -25,6 +25,7 @@ buildctl build ... \ - The export of Nydus image and runtime (e.g. [docker](https://github.com/dragonflyoss/image-service/tree/master/contrib/docker-nydus-graphdriver), [containerd](https://github.com/containerd/nydus-snapshotter), etc.) is currently only supported on linux platform. - Nydus image layers cannot be mixed with other compression types in the same image, so the `force-compression=true` option is automatically enabled when exporting both Nydus compression type and other compression types. +- Since the Nydus image layer does not correspond to the cache records, the inline cache export of Nydus image is unsupported. - Specifying a Nydus image as a base image in a Dockerfile is not currently supported (i.e. lazily pull using a Nydus image). ### Other ways to create Nydus images diff --git a/solver/llbsolver/solver.go b/solver/llbsolver/solver.go index 1ffcbcbd5c9dc..bd339fd3faa77 100644 --- a/solver/llbsolver/solver.go +++ b/solver/llbsolver/solver.go @@ -306,6 +306,12 @@ func inlineCache(ctx context.Context, e remotecache.Exporter, res solver.CachedR if efl, ok := e.(interface { ExportForLayers(context.Context, []digest.Digest) ([]byte, error) }); ok { + if compressionopt.Type == compression.NydusBlob { + // Since the nydus image layer does not correspond to the cache records, + // the inline cache export of nydus image is disabled here. + return nil, errors.Errorf("inline cache with %s compression is unsupported", compressionopt.Type) + } + workerRef, ok := res.Sys().(*worker.WorkerRef) if !ok { return nil, errors.Errorf("invalid reference: %T", res.Sys())