Add --push and --load support to build cmd#367
Open
jossemargt-cto-ai wants to merge 1 commit intogenuinetools:masterfrom
Open
Add --push and --load support to build cmd#367jossemargt-cto-ai wants to merge 1 commit intogenuinetools:masterfrom
jossemargt-cto-ai wants to merge 1 commit intogenuinetools:masterfrom
Conversation
Turns out --push flag was simply a rehashing of buildkit output attributes between existing command arguments plus the type=image and push=true buildkit ones. In the other hand --load became a mere dummy parameter since img simulates a docker registry through its own implementation. The --output=type=registry is a wash, since the user STILL needs to pass all the buildkit args within the output string. Signed-off-by: Jonnatan Jossemar Cordero <jossemar.cordero@cto.ai>
795be65 to
d868c18
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem statement
I found myself in the situation where I needed to give my users a migration path from
imgtodocker + buildkit, which roughly translates into adding support to the--push,--loadand--output=type=registryflags.I'm well aware this project is not longer maintained, as per expressed in #348; however, I wanted to put this PR out there in case someone else stumbles with a similar situation.
Changeset Description
In summary, this quick patch allows
imgto rehash buildkit'soutputattributes based on the new flags presence.The last statemet stands true with the only exception for the
--loadflag, which I preferred to add as a dummy one sinceimgalready simulates a docker registry through its own implementation. However, if we need a fully complaint solution I would suggest to incoporate #327 first, then add the proper behavior to this flag (dump resultingtarin STDOUT and pipe it again through STDIN as separate process).