-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Allow adding stages to run builds for things like compiled programs #108
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
Comments
I find this perfectly usable, it just needs to allow the same inclusion of other .yml files that main modules do. And yeah it's really helpful to include software not packaged for fedora in a universal blue system, it auto updated on each build and a bash script to build a software is way simpler than figuring out how to package it as a rpm |
This sems alright, I'm just kind of hesitant about adding more to the top-level recipe namespace, especially as base image verification etc. will also require such additions. I had initially thought that this could be implemented as a module or a flag to the containerfile module, that would allow just inserting into the containerfile before the main |
Having a separate stages section will help to keep the logic for managing modules cleaner and keep a very distinct separation of duties for these different functions. Allowing the use of modules would then allow reuse of existing configs to perform steps like the scripts module or files module and keep the users recipe file cleaner and easier to understand. This also has the benefit of conveying to the user that modules that happen in a stage are distinctly separate from their final image. Reuse of stages would also allow greater configurability for larger projects like secureblue. We could also add a |
Just dropping this enough. Kind of funny that Vib just introduced stages. https://docs.vanillaos.org/vib/en/recipe-structure |
Yeah similar to that! |
I've been thinking of this idea for a while now and I've heard from one of our users that they would like to do something similar. So now that we've proven that multi-stage builds will work for us, we can take advantage of that to allow users to create their own stages. This would be useful for compiling software that might require a specific set of dependencies that you don't want in your final image.
Spec
For creating a stage, I thought that the best way to represent a set of stages was to add a
stages
property in the top level of the file. Here you have a list of stages with the required properties ofname
,image
, andmodules
. The user would then be able to add modules to call from within the stage. In the example below, I'm using thecontainerfile
module to buildbluebuild
usingcargo
on therust
image. Then in the main modules, I'm usingCOPY
to copy the bin into the final image without having to install all of thecargo
dependencies in my final image.The resulting
Containerfile
would end up looking something like this:Adding support for
from-file:
would also make this extremely modular and allow for easy reuse. It can follow the same patter where it could be a single stage:Or it can hold multiple ones
The text was updated successfully, but these errors were encountered: