Add --push and --load support to build cmd #367
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).