Skip to content

Resolve manifest with conversions #83

@shizhMSFT

Description

@shizhMSFT

distribution supports manifest conversion between manifest types by setting the Accept header.

There are two types of conversion supported by distribution as in the code

  • Convert docker schema2 manifests to scheme1 manifests.
  • Convert a manifest list down to a schema2 manifest.

Depending on the registry implementation, more conversions are supported. For instance, ACR supports

  • Convert docker schema2 manifest to OCI manifest.
  • Convert docker schema2 manifest list to OCI index.

While having the convenience of convertion, we have issues with digests and applications that depend on digests (e.g. signatures) since the converted manifest cannot be accessed by digest.

Output of a converted docker schema2 manifest:

$ curl "http://localhost:5000/v2/alpine/manifests/latest" -I
HTTP/1.1 200 OK
Content-Length: 2735
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:c2daf493729aa76b0e4ac53e56d3e45889d17aa94773593d18d7f6924f0c7e1b
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:c2daf493729aa76b0e4ac53e56d3e45889d17aa94773593d18d7f6924f0c7e1b"
X-Content-Type-Options: nosniff
Date: Tue, 07 Dec 2021 06:17:47 GMT

$ curl "http://localhost:5000/v2/alpine/manifests/sha256:c2daf493729aa76b0e4ac53e56d3e45889d17aa94773593d18d7f6924f0c7e1b" -I
HTTP/1.1 404 Not Found
Content-Type: application/json
Docker-Distribution-Api-Version: registry/2.0
X-Content-Type-Options: nosniff
Date: Tue, 07 Dec 2021 06:17:56 GMT
Content-Length: 182

To avoid ambiguity, oras-go is designed not to do type conversion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions