-
Notifications
You must be signed in to change notification settings - Fork 495
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
Bake target dependencies #141
Comments
Afaik there is no depends on at build time, only run time, for compose |
I too have not two but 3 layers of builds for compose and buildkit. |
|
@teohhanhui |
There is indeed no guarantee about that, but in practice it does work: docker/compose#6332 (comment) |
not sure what that link is supposed to add? until it does offer that option via targets, what I do is have multiple YAML |
Is there no plan to support such a feature? |
If I'm not mistaken, this is now possible, via the I think this can be closed. |
Thanks @maxheld83, this seems to be what I was looking for! |
One notable missing feature of the high-level build construct offered by the
bake
command is the ability to express dependencies between targets. Compose provides a valid "depends on" parameter, but from my reading it looks like this is currently dropped when compose files are read by bake.My use case is a good example; I have a Go codebase that produces lots of Go binaries. Many of those binaries get stuffed into containers to run as long-lived daemons, many get used in other various container images also built by my repo, and some wind up in both. I have a
go_container.dockerfile
that looks approximately like this:Which I'm then invoking using one target with the correct arg per daemon-container I want to build, plus once as a generic
go_builder
target, just to get the image with all the built binaries in the local registry. I also have atoolbox.dockerfile
that looks approximately like this:And I have tens of dockerfiles that follow a similar pattern to this one. The trick is that
go_builder
needs to be built before we can start executing the toolbox image.Currently, I'm solving for this by invoking bake twice: once for the core go containers and once for everything else, though that limits the expressiveness of my dependencies and leads to less-than-perfect utilization of my compute power. A working depends-on parameter would solve for both concerns.
The text was updated successfully, but these errors were encountered: