-
Notifications
You must be signed in to change notification settings - Fork 640
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
support for DOCKER_BUILDKIT=1 environment variable #1267
Comments
I don't know what However, multi-stage should be already possible with dmp out of the box. |
Just ran into this, |
Btw, I think there should (also) be a plugin config flag to enable BuilKit. |
@famod : Do you if there is some kind of query parameter in REST API to honor DOCKER_BUILDKIT? Or is this something that is specific to docker CLI? |
@rohanKanojia no idea really, sorry! But it seems to be no easy feat: testcontainers/testcontainers-java#2857 (comment) |
Did some investigation in the scope of #1502, see my comment there: |
@tfactor2 thanks for your investigations, really helpful ! I also think that having multi-arch support (for which you do need buildkit) would be a very useful feature to have (not only to support Apple's M1 but also for RasPi based builds). In addition, BuildKit also helps in generating the proper Docker manifest so that we could push multi-arch images to registries). I don't really know the BuildKit (or 'version 2' API) but I think it would be a worthful task to tackle, that I would split into two parts:
d-m-p already has support for a second build mechanism (via JIB), so theoretically it should not be impossible to hook in a third build mechanism via BuildKit with its new API. Unfortunately, I have zero time to investigate or implement this interesting use case :-( but I'm supportive of any questions (saying this while already being miles away from the code for quite some time). But I'm pretty sure we would get a PR integrated, together with @rohanKanojia who actually is the maintainer of this plugin. However, this only works with somebody who is fancy to step up for the implementation. |
Looks like the BuildKit API turned to be very complicated to use. Python guys decided to don't implement it docker/docker-py#2230 (docker-py library), but rather wrap docker cmd with python (python-on-whales library, see https://gabrieldemarmiesse.github.io/python-on-whales/#why-another-project-why-not-build-on-docker-py). For me JIB has a major disadvantage - it doesn't use |
Well, if this is the case, I wouldn't mind to do the same for multi-arch builds. We have a nice abstraction within d-m-p for doing the builds, so having an implementation that calls out to the CLI is not something out of scope. Of course, there should be still support for v1 via a remote rest API (TCP/unix-socket), but nobody prevents us from requiring a builkit installation for more advance operations (like multi-arch builds)
True, but if it fits perfectly the 'standard java app' which has three layers: base image, dependencies, your code. It's very restricted what you can do, but for many use cases starting up a java process is good enough. What you get from JIB is much faster image build and push times (because the dependency layer rarely changes). But your mileage may vary, still, you have the choice. |
For layering, we are using Spring Boot layers thus JIB is not that useful for us. |
We looked into integrating cross-platform Docker build capabilities into the docker-maven-plugin over the last two days during a small hackathon, and I want to share what we learned so far: Using buildx instead of buildWorking with buildx requires booting up a proper builder, e.g. using Building multi-arch images with buildx works great - but they are then residing inside that builder container - not where we can actually start the image, or add tags or so. Instead, buildx allows you to either In our expriment, we hooked in a command-line invocation of Worse: we can't pass on the credentials from the nice credential chain that d-m-p uses (neither for pulling base images, nor for pushing), we can only rely on the All in all, the buildx semantics don't really fit the flow that's currently used within the d-m-p goals to build, start, tag, push. Limitations in the capabilities of buildx (for passing credentials, for exporting all created images AND also exporting a proper list-manifest) are tedious to work around. Using
|
Hey, @agudian that's an awesome investigation of the situation and very very helpful ! Thanks a ton ! I agree that probably having a separate wrt/ the challenge to have the built image available for e.g. Creating a local registry is probably out of scope, except that there would be already a Java library that would handle that. Registries are hard to implement correctly. Said all that, unfortunately, I can't really invest time in helping to implement that (as much as I wanted it, but I'm currently totally overloaded with completely different work). But we (@rohanKanojia and I) are happy to help to integrate PRs that go into this direction. |
I just discovered today that the |
Description
I would like to take advantage in my build of DOCKER BUILDKIT. Not only it runs faster, but has significant improvements like FROM ... AS that makes the images smaller.
I checked and it does not look like it is currently possible with the plugin.
I would like the plugin to respect the environment variable DOCKER_BUILDKIT, or have any other way of passing that information to the build engine.
The text was updated successfully, but these errors were encountered: