Added OCI v1 support to image download file.#48533
Added OCI v1 support to image download file.#48533jjimbo137 wants to merge 17 commits intomoby:masterfrom jjimbo137:master
Conversation
Added additions to handle OCI container V1 format. This added handling for the mediaType in both the manifest and layer sections.
Shortened to minimum code because OCI v1 is essentially equivalent to Docker v2.2 format. Also fixed formatting issue with jq where it wouldn't accept newline character in chained jq commands.
|
Thank you for contributing! It appears your commit message is missing a DCO sign-off, We require all commit messages to have a There is no need to open a new pull request, but to fix this (and make CI pass), Unfortunately, it's not possible to do so through GitHub's web UI, so this needs You can find some instructions in the output of the DCO check (which can be found Steps to do so "roughly" come down to:
Sorry for the hassle (I wish GitHub would make this a bit easier to do), and let me know if you need help or more detailed instructions! |
tianon
left a comment
There was a problem hiding this comment.
A few nits/suggestions and a question 🙇 ❤️
Updating per suggestion. Co-authored-by: Tianon Gravi <[email protected]>
updating per suggestion Co-authored-by: Tianon Gravi <[email protected]>
Updating per suggestion Co-authored-by: Tianon Gravi <[email protected]>
Updating per suggestion Co-authored-by: Tianon Gravi <[email protected]>
Updating per suggestion Co-authored-by: Tianon Gravi <[email protected]>
Updated per suggestions from merge review.
Removed redundant accept statements. Signed-off-by: Jimbo Jones <[email protected]>
|
I think I just signed the commit and made all the updates. I'm not great with git yet. Thanks for sharing! |
|
Thanks! I see that the last commit has a sign-off, but there's now many commits in the PR. We generally squash commits so that there's only a single commit in the PR; can you squash the commits? Let me try outline the steps for that; Assuming your "upstream" remote points to the upstream (https://github.com/moby/moby) repository and "origin" remote points to your fork, steps are as follows; First fetch your remotes are up-to-date; git fetch upstream
git fetch originThen start an interactive rebase on top of the "master" branch in "upstream" (upstream being the https://github.com/moby/moby repository); git rebase --interactive upstream/masterThe interactive rebase opens a temporary file in your default editor, which contains the list of commits in your PR, and allows you to tell git what to do with those commits as part of the rebase; p fe967bdab3 Update download-frozen-image-v2.sh to include OCI containers
p 1673f5a212 Update download-frozen-image-v2.sh added OCI v1 support
p ba24b190de Update contrib/download-frozen-image-v2.sh
p 6a5411109f Update contrib/download-frozen-image-v2.sh
p e3fb8a8b7b Update contrib/download-frozen-image-v2.sh
p fded672057 Update contrib/download-frozen-image-v2.sh
p 86f86d60cb Update contrib/download-frozen-image-v2.sh
p 67252baac9 Update download-frozen-image-v2.sh
p 784f291e28 Update download-frozen-image-v2.sh
# Rebase 3cf65ec598..784f291e28 onto 3cf65ec598 (9 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# .....You can edit this file to control what git will do with your changes; the first column in the list of commits indicates what you want to happen with that commit; it defaults to To do so, change the first column of all the "commit" lines from p fe967bdab3 Update download-frozen-image-v2.sh to include OCI containers
s 1673f5a212 Update download-frozen-image-v2.sh added OCI v1 support
s ba24b190de Update contrib/download-frozen-image-v2.sh
s 6a5411109f Update contrib/download-frozen-image-v2.sh
s e3fb8a8b7b Update contrib/download-frozen-image-v2.sh
s fded672057 Update contrib/download-frozen-image-v2.sh
s 86f86d60cb Update contrib/download-frozen-image-v2.sh
s 67252baac9 Update download-frozen-image-v2.sh
s 784f291e28 Update download-frozen-image-v2.shAfter you modified those lines, save the file, and exit the editor; git will now perform the squash; it will open another editor, asking you to write the commit message for the combined commits; # This is a combination of 9 commits.
# This is the 1st commit message:
Update download-frozen-image-v2.sh to include OCI containers
Added additions to handle OCI container V1 format. This added handling for the mediaType in both the manifest and layer sections.
# This is the commit message #2:
Update download-frozen-image-v2.sh added OCI v1 support
Shortened to minimum code because OCI v1 is essentially equivalent to Docker v2.2 format. Also fixed formatting issue with jq where it wo>
# This is the commit message #3:
...
...You can remove all the lines you don't need for the commit message; comment-lines (lines starting with Update download-frozen-image-v2.sh added OCI v1 support
Shortened to minimum code because OCI v1 is essentially equivalent to
Docker v2.2 format. Also fixed formatting issue with jq where it wouldn't
accept newline character in chained jq commands.
Co-authored-by: Tianon Gravi <[email protected]>
Signed-off-by: Jimbo Jones <[email protected]>After you made your changes, safe the file, and exit your editor; git now completes the rebase; These changes are only local on your machine, so now have to be pushed. Given that "rebase" and "squash" rewrites history, you need to "force push" your change. |
Shortened to minimum code because OCI v1 is essentially equivalent to Docker v2.2 format. Also fixed formatting issue with jq where it wouldn't accept newline character in chained jq commands. Update contrib/download-frozen-image-v2.sh Updating per suggestion. Co-authored-by: Tianon Gravi <[email protected]> Update contrib/download-frozen-image-v2.sh updating per suggestion Co-authored-by: Tianon Gravi <[email protected]> Update contrib/download-frozen-image-v2.sh Updating per suggestion Co-authored-by: Tianon Gravi <[email protected]> Update contrib/download-frozen-image-v2.sh Updating per suggestion Co-authored-by: Tianon Gravi <[email protected]> Update contrib/download-frozen-image-v2.sh Updating per suggestion Co-authored-by: Tianon Gravi <[email protected]> Update download-frozen-image-v2.sh Updated per suggestions from merge review. Update download-frozen-image-v2.sh Removed redundant accept statements. Signed-off-by: Jimbo Jones <[email protected]>
Shortened to minimum code because OCI v1 is essentially equivalent to Docker v2.2 format. Also fixed formatting issue with jq where it wouldn't accept newline character in chained jq commands. Co-authored-by: Tianon Gravi <[email protected]> Updated per suggestions from merge review. Removed redundant accept statements. Signed-off-by: Jimbo Jones <[email protected]> Update contrib/download-frozen-image-v2.sh updating per suggestion Co-authored-by: Tianon Gravi <[email protected]> Update contrib/download-frozen-image-v2.sh Updating per suggestion Co-authored-by: Tianon Gravi <[email protected]> Update contrib/download-frozen-image-v2.sh Updating per suggestion Co-authored-by: Tianon Gravi <[email protected]> Update contrib/download-frozen-image-v2.sh Updating per suggestion Co-authored-by: Tianon Gravi <[email protected]> Update download-frozen-image-v2.sh Updated per suggestions from merge review. Update download-frozen-image-v2.sh Removed redundant accept statements. Signed-off-by: Jimbo Jones <[email protected]>
|
I just checked out my github fork, so don't have the upstream branch in it. I tried to squash by doing "git log download-fro...." and do a rebase -i from the first commit (fe967bd), but it seems to leave that one out after the squash. Not sure how to proceed. |
Shortened to minimum code because OCI v1 is essentially equivalent to Docker v2.2 format. Also fixed formatting issue with jq where it wouldn't accept newline character in chained jq commands. Co-authored-by: Tianon Gravi <[email protected]> Signed-off-by: Jimbo Jones <[email protected]>
|
I pushed a rebased and squashed version of your commits to #48546 |
|
This was merged as; Thanks for contributing! |
- What I did
Added support for OCI v1 image support. Also fixed issue with chained jq commands where it wasn't accepting newline characters.
- How I did it
Added the OCI v1 media type tags to the acceptable download formats.
- How to verify it
Tested on registry-1 for 1 layer and multi-layer downloads. both worked and downloaded the docker images.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)