estesp / manifest-tool

Command line tool to create and query container image manifest list/indexes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Push support for types.OCI

deitch opened this issue · comments

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?

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

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!

25aa9ae#diff-90831dc0f77a32f7a21aba91c0a5e34a15910c0709e2f20fb951d3b0c02afedaL140-L143

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

I did that? 🤣

I will open a PR for it.

Thanks!

Have a look at #181