Skip to content

Conversation

@jossemargt-cto-ai
Copy link

@jossemargt-cto-ai jossemargt-cto-ai commented Jan 15, 2024

Problem statement

I found myself in the situation where I needed to give my users a migration path from img to docker + buildkit, which roughly translates into adding support to the --push, --load and --output=type=registry flags.

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 img to rehash buildkit's output attributes based on the new flags presence.

The last statemet stands true with the only exception for the --load flag, which I preferred to add as a dummy one since img already 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 resulting tar in STDOUT and pipe it again through STDIN as separate process).

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 <[email protected]>
@jossemargt-cto-ai jossemargt-cto-ai force-pushed the hack/mimic-push-and-load-flags-upon-build branch from 795be65 to d868c18 Compare January 17, 2024 22:44
@jossemargt-cto-ai jossemargt-cto-ai changed the title HACK: Add --push and --load support to build cmd Add --push and --load support to build cmd Jan 23, 2024
@jossemargt-cto-ai jossemargt-cto-ai marked this pull request as ready for review January 23, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant