Skip to content

Commit ec60b70

Browse files
jnohlgardsmira
authored andcommitted
fix: set media type to OCI for image cache layer
The other components of the image cache image are using OCI media types, setting the layer to OCI instead of the default Docker layer type is more technically correct. This also works around a bug in skopeo that refuses to recognize Docker layers inside OCI images. Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se> Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent a471eb3 commit ec60b70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/imager/filemap/filemap.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717

1818
v1 "github.com/google/go-containerregistry/pkg/v1"
1919
"github.com/google/go-containerregistry/pkg/v1/tarball"
20+
"github.com/google/go-containerregistry/pkg/v1/types"
2021
)
2122

2223
// File is a path -> file content map representing a file system.
@@ -151,5 +152,5 @@ func Layer(filemap []File) (v1.Layer, error) {
151152
// Return a new copy of the buffer each time it's opened.
152153
return tarball.LayerFromOpener(func() (io.ReadCloser, error) {
153154
return Build(filemap), nil
154-
})
155+
}, tarball.WithMediaType(types.OCILayer))
155156
}

0 commit comments

Comments
 (0)