estesp / manifest-tool

Command line tool to create and query container image manifest list/indexes
Apache License 2.0
741 stars 92 forks source link

Push support for types.OCI #180

Closed deitch closed 2 years ago

deitch commented 2 years ago

When calling PushManifestList, it always sets the image.Type to types.Docker, which resolves to "application/vnd.docker.distribution.manifest.list.v2+json". It never uses types.OCI, which resolves to the OCI "application/vnd.oci.image.index.v1+json".

Besides the desire to push out a proper OCI index, Docker Hub appears to have an issue where it will accept creation of a new index (POST) with the "application/vnd.docker.distribution.manifest.list.v2+json" media type, but gets quite unhappy when you update an existing one (PUT).

We shouldn't have to work around Hub's bugs, of course, but it would be good for us to be able to specify the OCI index vs Docker multi-arch manifest.

Unless there is some way to set it that it I am missing?

deitch commented 2 years ago

And if it isn't, and you want a PR, I am happy to open one. I guess another parameter for PushManifestList()?

estesp commented 2 years ago

I almost didn't believe you, but then I found it was you who removed that feature 😇 😓 😂

When you moved the code around to be more "library consumable" in #104 we lost the client context that was being used to differentiate OCI vs. Docker v2 pushes. Of course totally my bad to miss this when I reviewed the PR!

https://github.com/estesp/manifest-tool/commit/25aa9ae1deaf5ddb0be0b3f3c8d375c679906e8f#diff-90831dc0f77a32f7a21aba91c0a5e34a15910c0709e2f20fb951d3b0c02afedaL140-L143

So, that OCI flag needs to get into the PushManifestList function so we can return to that behavior.

deitch commented 2 years ago

I did that? 🤣

I will open a PR for it.

estesp commented 2 years ago

Thanks!

deitch commented 2 years ago

Have a look at #181