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

Support OCI images #87

Open
stelford opened this issue Jan 28, 2020 · 4 comments
Open

Support OCI images #87

stelford opened this issue Jan 28, 2020 · 4 comments

Comments

@stelford
Copy link

Howdy.

Currently, if I run registry against a docker registry which has OCI images (generated from podman for example). I get the dreaded "OCI manifest found, but accept header does not support OCI manifests" when using this tool. If any one runs into this, the fix is pretty darned simple. Please change the registry.py as below;

     HEADERS = {"Accept":
-               "application/vnd.docker.distribution.manifest.v2+json"}
+               "application/vnd.docker.distribution.manifest.v2+json,application/vnd.oci.image.manifest.v1+json"}
 

Regards.

@andrey-pohilko
Copy link
Owner

andrey-pohilko commented Jan 28, 2020 via email

@tkarls
Copy link

tkarls commented Jan 20, 2022

There is another type. oci index images that gets generated by buildkit cache exports.
These images require the

application/vnd.oci.image.index.v1+json

Accpept value. Unfortunatly simply adding this to the Accept header is not sufficient. When trying to delete images older than x hours I get:

Traceback (most recent call last):
  File "/registry.py", line 858, in <module>
    main_loop(args)
  File "/registry.py", line 853, in main_loop
    args.delete_by_hours, keep_tags)
  File "/registry.py", line 641, in delete_tags_by_age
    image_config = registry.get_tag_config(image_name, tag)
  File "/registry.py", line 369, in get_tag_config

I assume that the manifest is a bit different but it would be great if this tool could support them as well! It really helps with the CI cleanup.

@ddelange
Copy link

related to docker/buildx#1509: as of v0.10.0, OCI manifests are pushed by default

@rwojsznis
Copy link

Accpept value. Unfortunatly simply adding this to the Accept header is not sufficient. When trying to delete images older than x hours I get:

I ran into same issue on a different project; I don't follow build/docker/oci specification so I just searched through github and shoved:

"application/vnd.docker.distribution.manifest.v1+json, application/vnd.docker.distribution.manifest.v1+prettyjws, application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.v2+prettyjws, application/vnd.oci.image.index.v2+json, application/vnd.oci.image.index.v1+json, application/vnd.oci.image.manifest.v2+json, application/vnd.oci.image.manifest.v1+json"

into Accept header (based on other repos); at first glance it seems to "solve" the problem 🤔

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

No branches or pull requests

5 participants