Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OCI Image Manifest #261

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chantra
Copy link

@chantra chantra commented Feb 9, 2024

Image like s390x/ubuntu uses OCI Image Manifest, which per
https://github.com/opencontainers/image-spec/blob/v1.0.1/manifest.md
is very similar to vnd.docker.distribution.manifest.v2.

Add a test to confirm we can deserialize an OCI Image Manifest as a ManifestSchema2Spec.

Also add a test to confirm that we can now fetch the manifest from docker.io.
Previously it would fail with MANIFEST_UNKNOWN.

This is built on top of #260 . I stacked it because it would otherwise have merge conflicts due to the tests.

@chantra
Copy link
Author

chantra commented Feb 9, 2024

As a follow up, I am happy to revive #244 if @luizribeiro can't get to it.

Previously, a generic error would be returned:
```
Error: unexpected HTTP status 404 Not Found
```

This does not convey much information as to what happens.
On the current version of dkregistry, one would hit this when trying to
access s390x/ubuntu on registry-1.docker.io.

This change specializes the error to surface more information as to why the
error is happening as described in the OCI Distribution Specification:
https://github.com/opencontainers/distribution-spec/blob/main/spec.md#error-codes

In this specific case, the error would look like:
```
Error: Api Error: ((MANIFEST_UNKNOWN), message: OCI manifest found, but accept header does not support OCI manifests)

Caused by:
    ((MANIFEST_UNKNOWN), message: OCI manifest found, but accept header does not support OCI manifests)
```

which clearly highlight that dkregistry does not support OCI manifest.
Image like s390x/ubuntu uses OCI Image Manifest, which per
https://github.com/opencontainers/image-spec/blob/v1.0.1/manifest.md
is very similar to vnd.docker.distribution.manifest.v2.

Add a test to confirm we can deserialize an OCI Image Manifest as a ManifestSchema2Spec.

Also add a test to confirm that we can now fetch the manifest from docker.io.
Previously it would fail with MANIFEST_UNKNOWN.
OCI Image Index (https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md)
is similar to vnd.docker.distribution.manifest.list.v2

This revives camallo#244 originally created by @luizribeiro

A testing client could pull koenkk/zigbee2mqtt:latest with this change.

Fixes camallo#243
@chantra
Copy link
Author

chantra commented Feb 13, 2024

@PratikMahajan if you could look into this one too, that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant