Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use curl command to get manifest v2 schema version 2

Tags:

curl -H "Authorization: Bearer $BEARER" \
     -H "Accept: application/vnd.docker.image.manifest.v2+json" \
     https://registry-1.docker.io/v2/$NAME/manifests/sha256:3eb57a4024e69d05ace49be70ab9d13610cfe611a0191c7edc26f5a2b675e7b1

Above is the command I use. I've already set the Accept field to be schema version 2 manifest media type in the header but still it returns me manifest with schema version 1

like image 227
Lizhu Qi Avatar asked Apr 20 '16 17:04

Lizhu Qi


People also ask

What is curl command in docker?

curl is a command line tool and library for transferring data with URLs. curl is used in command lines or scripts to transfer data.

What is manifest in docker file?

A manifest list is a list of image layers that is created by specifying one or more (ideally more than one) image names. It can then be used in the same way as an image name in docker pull and docker run commands, for example.

How do I get docker digest?

The Docker image digest SHA is a critical piece of evidence that makes a container and the content unique. You get the Docker image digest SHA from an image stored in a docker registry. Easy to do if the image has been pulled, just run docker image ls <image> –digests.

Is docker a HTTP registry?

The Docker Registry HTTP API is the protocol to facilitate distribution of images to the docker engine. It interacts with instances of the docker registry, which is a service to manage information about docker images and enable their distribution.


1 Answers

I believe the Accept type for a v2 schema is "application/vnd.docker.distribution.manifest.v2+json" according to the docker registry code, see:

https://github.com/docker/distribution/blob/f4b6fc8d681c42137b7d2bb544b087462bc34d47/manifest/schema2/manifest.go#L15

like image 102
Todd Avatar answered Sep 28 '22 03:09

Todd