Skip to content

build directly with buildkit#3791

Merged
deitch merged 2 commits intolinuxkit:masterfrom
deitch:direct-buildkit
Jul 1, 2022
Merged

build directly with buildkit#3791
deitch merged 2 commits intolinuxkit:masterfrom
deitch:direct-buildkit

Conversation

@deitch
Copy link
Copy Markdown
Collaborator

@deitch deitch commented Jun 16, 2022

Signed-off-by: Avi Deitcher [email protected]

- What I did

For package builds, replaced the usage of docker buildx build with running a buildkit container in a given context and calling the buildkit API directly to that container.

Updated the docs in packages.md as well.

Also provides options to override the builder image to use (default is moby/buildkit:v0.10.3) as well whether or not to force a stop/rm/restart of the build image. It has logic that will do that if the build image version is incorrect or it is missing permissions.

- How to verify it

CI should handle it, as it builds for all platforms.

- Description for the changelog

Direct buildkit usage.

- Additional notes

In principle, this doesn't do too much different than we did with docker buildx build. It uses contexts to determine where to build, relying on CLI flags or env var or default.

What this does buy us is new features. Until now, we were bound by whatever image is in the installed version of buildx, and whatever features are there. This allows us to override the above.

We also had put constraints on the docker version. Now we only need support for contexts, nothing else.

I fully intend to use this as the OCI layout source merges in.

At some point, when buildx and buildkit are very stable, we may choose to remove these changes.

@deitch deitch force-pushed the direct-buildkit branch 2 times, most recently from 39a7ce6 to e068954 Compare June 16, 2022 09:50
Comment thread src/cmd/linuxkit/pkglib/build.go Outdated
@deitch deitch force-pushed the direct-buildkit branch from e068954 to 97047d3 Compare June 23, 2022 09:46
@rn
Copy link
Copy Markdown
Member

rn commented Jun 27, 2022

there are upwards of 1000 files changed. Is there any chance of breaking this down to changes which matter and changes which are presumably automated updates.

@deitch
Copy link
Copy Markdown
Collaborator Author

deitch commented Jun 28, 2022

We can split it out into 2 commits, although we had better squash before merging.

The only ones that really matter are those in src/cmd/linuxkit/; everything else is just vendored dependencies.

@deitch deitch force-pushed the direct-buildkit branch from 97047d3 to 0929aab Compare June 28, 2022 07:36
@deitch
Copy link
Copy Markdown
Collaborator Author

deitch commented Jun 28, 2022

I split it out into 2 commits. The first updates go.mod, go.som and src/cmd/linuxkit/vendor/, so just packages/modules.

The second is just a few files with the actual changes. Take another look @rn

@deitch deitch merged commit 7778f34 into linuxkit:master Jul 1, 2022
@deitch deitch deleted the direct-buildkit branch July 1, 2022 09:29
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.

4 participants