registry-cli icon indicating copy to clipboard operation
registry-cli copied to clipboard

Support OCI images

Open stelford opened this issue 4 years ago • 4 comments

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.

stelford avatar Jan 28 '20 20:01 stelford

Thanks for the suggestion. We will add this into the master branch with some additional command line argument (--oci, I think)

Dne út 28. 1. 2020 21:04 uživatel stelford [email protected] napsal:

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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/andrey-pohilko/registry-cli/issues/87?email_source=notifications&email_token=AECNB634AVPCTFD5BKFBKKTRACFTHA5CNFSM4KMYOFMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IJKSDQQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECNB64XVTEL662F5I53WTLRACFTHANCNFSM4KMYOFMA .

andrey-pohilko avatar Jan 28 '20 20:01 andrey-pohilko

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.

tkarls avatar Jan 20 '22 14:01 tkarls

related to https://github.com/docker/buildx/issues/1509: as of v0.10.0, OCI manifests are pushed by default

ddelange avatar Jan 26 '23 13:01 ddelange

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 🤔

rwojsznis avatar Oct 01 '23 15:10 rwojsznis