-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubler Build breaks with docker buildx #215
Comments
Since you've pointed back to my issue, i might add that i am still not convinced using buildx. I haven't had a deeper look into it but i would assume that most of the time people will just use already prebuild images as parents. So basically just pull an ARM image of Alpine and go on from there. Is anyone actually building the OS from scratch with buildx? Even so, will those people use the exact same set of defaults for multiple architectures? Because that's pretty much what Kubler would currently do. There are a couple issues building images for multiple platforms using Kubler and Gentoo. Maybe i haven't spend enough effort to it but for me it was the best option to just have multiple builders. So i have a builder for |
Thanks for your thoughts. I think supporting both traditional Docker build and buildx (BuildKit) would be good. IMO sooner or later Docker will switch to BuildKit and deprecate the old build and later remove it. So eventually this work will need to be done. Currently if people have switched to buildx as default, via install, kubler breaks. So at a minimum it should be documented and instructions on how to work around it (use old builder). I use Kubler to build images for a single purpose often with a single binary, and hence based off scratch as parent. I would like multiplatform versions of these. It is just several images bundled together by a manifest. I could do that outside of kubler in CI/CD or I could just use different names or tags, which is what you must be doing. Yesterday I was working on using Kubler in CI/CD and caching the Docker images, and layers, would greatly increase the speed of the pipeline runs. This would be easy to achieve with buildx, if it worked in kubler. Yesterday I realised that naming the builders etc kubler/* makes it not conducive to everyone building their own (gentoo style) and pushing them (owner/name conflicts). It's conducive to centrally built and everyone pulling (Docker style). For me I like that I build them (control). Thinking about it more today, if this was prefixed like |
- buildx breaks kubler edannenberg/kubler#215
If Kubler supports buildx, i might give it a try. But even so, i still wonder how you'll manage to work with Kubler + Gentoo and the Docker approach to multiplatform support. I am sure it will be possible to tweak Kubler into working with the buildx way of dealing with mutiple platforms. How do you plan to build the builders (bob) for each platform? I am currently using 2 builders and called them I am using the Kubler images with CI/CD as well. But not the building process of Kubler itself. Instead i am building them manually and cache the final images in my registry using date tags. After using Kubler for quite some time, i don't trust the build process to be solid enough to not be a constant pain with a CI/CD on top. That's not Kublers fault at all. Rather the fact that Gentoo is always on the move with things and also that building into Docker is not really supported by Gentoo. So every other rebuild, i am running into some issues here and there. Then i need to step in to fix the image in question. |
I don't know yet, but I plan to work on it. I am hoping to minimise the differences between the images (the kubler definitions) and the builders, and just running buildx with multiple platforms (amd64 and arm64), and getting both working. But potentially I'll need dedicated configs or some patch/diff... I'll try to come up with a good solution. I hear you regarding builds breaking often, due to gentoo and packages. That's part of why I want it in CI/CD though, so that it can be rebuilt periodically and if it breaks, the build will fail, and I'll be alerted and can fix it at my leisure rather than find out it broken when I want to use it. First, I'm going to try to get single platform working on buildx, and then try to get multiplatform. |
Looks like we are going to be forced to move to Buildkit sooner then later:
I am getting this warning now when using Kubler. |
If docker buildx is being used, due to either
docker buildx install
or setting envvarDOCKER_BUILDKIT=1
.kubler build
will break.I am interested in using buildx for several reasons:
I've been working on running
kubler
in CI/CD. I am caching the~/.kubler/downloads
,distfiles
, andpackages
, which makes subsequent runs much faster. But it is still fairly slow compared to running locally because it is building all the docker images, including portage and builders (kubler/bob
,kubler/bob-musl
, etc) on every run, which involves copying/loading large files (portage, and stage3s).I want to cache the docker images between runs, and I want to use buildx, which can cache layers in a docker registry, which is nice for CI/CD.
Trying to use buildx causes problems in kubler, because the buildx builder is a docker-container, the images are inside the builder container. This causes the
docker tag ...:latest
operations to fail as the image doesn't exist on the localhost.They need to be either loaded into the local host registry by given an extra
--load
argument or pushed to the remote registry with the--push
argument.Fixing that the next problem is that loading the stage3, the image is available on the localhost but not in the buildx builder container.
The local image needs to be loaded into the builder docker-container, but there isn't a straight forward way to do this.
NOTE: For multi-plaform images,
--load
won't work, as the locally registry doesn't yet understand multi-platform images. For multi-platformdocker buildx build --push
works, to upload it to remote registry.If
--push
isn't used to build a mult-platform image, then a multi-platform image could be created by creating a manifest and combining several images for different platforms, e.g. by usingdocker buildx imagetools create
.Supporting buildx will help with #200.
The text was updated successfully, but these errors were encountered: