From c98ef2ab172a197d756c603e961a0bfb6fe7e4ca Mon Sep 17 00:00:00 2001 From: ningmingxiao Date: Sat, 9 Jul 2022 00:02:13 +0800 Subject: [PATCH] fix skopeo copy can't entrypt to docker-daemon image Signed-off-by: ningmingxiao --- internal/image/oci.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/image/oci.go b/internal/image/oci.go index 4b74de3e58..82c1392333 100644 --- a/internal/image/oci.go +++ b/internal/image/oci.go @@ -8,6 +8,7 @@ import ( "github.com/containers/image/v5/docker/reference" "github.com/containers/image/v5/internal/iolimits" + ociencspec "github.com/containers/ocicrypt/spec" internalManifest "github.com/containers/image/v5/internal/manifest" "github.com/containers/image/v5/manifest" "github.com/containers/image/v5/pkg/blobinfocache/none" @@ -217,13 +218,13 @@ func (m *manifestOCI1) convertToManifestSchema2(_ context.Context, _ *types.Mani switch layers[idx].MediaType { case imgspecv1.MediaTypeImageLayerNonDistributable: layers[idx].MediaType = manifest.DockerV2Schema2ForeignLayerMediaType - case imgspecv1.MediaTypeImageLayerNonDistributableGzip: + case imgspecv1.MediaTypeImageLayerNonDistributableGzip,ociencspec.MediaTypeLayerNonDistributableGzipEnc : layers[idx].MediaType = manifest.DockerV2Schema2ForeignLayerMediaTypeGzip case imgspecv1.MediaTypeImageLayerNonDistributableZstd: return nil, fmt.Errorf("Error during manifest conversion: %q: zstd compression is not supported for docker images", layers[idx].MediaType) - case imgspecv1.MediaTypeImageLayer: + case imgspecv1.MediaTypeImageLayer,ociencspec.MediaTypeLayerEnc: layers[idx].MediaType = manifest.DockerV2SchemaLayerMediaTypeUncompressed - case imgspecv1.MediaTypeImageLayerGzip: + case imgspecv1.MediaTypeImageLayerGzip,ociencspec.MediaTypeLayerGzipEnc: layers[idx].MediaType = manifest.DockerV2Schema2LayerMediaType case imgspecv1.MediaTypeImageLayerZstd: return nil, fmt.Errorf("Error during manifest conversion: %q: zstd compression is not supported for docker images", layers[idx].MediaType)