images, remotes: add support for foreign layers
Add support for downloading layers with external URLs and foreign/non-distributable mediatypes. This ensures that encountered windows images are downloaded correctly. We still need to filter out the extra windows resources when pulling linux, but this is a step towards correctly supporting multi-platform images. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
@@ -27,6 +27,7 @@ func MakeRefKey(ctx context.Context, desc ocispec.Descriptor) string {
|
||||
case images.MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex:
|
||||
return "index-" + desc.Digest.String()
|
||||
case images.MediaTypeDockerSchema2Layer, images.MediaTypeDockerSchema2LayerGzip,
|
||||
images.MediaTypeDockerSchema2LayerForeign, images.MediaTypeDockerSchema2LayerForeignGzip,
|
||||
ocispec.MediaTypeImageLayer, ocispec.MediaTypeImageLayerGzip,
|
||||
ocispec.MediaTypeImageLayerNonDistributable, ocispec.MediaTypeImageLayerNonDistributableGzip:
|
||||
return "layer-" + desc.Digest.String()
|
||||
|
||||
Reference in New Issue
Block a user