Skip to content
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

add support for build-arg files #3987

Merged
merged 1 commit into from
Feb 22, 2024
Merged

Conversation

deitch
Copy link
Collaborator

@deitch deitch commented Feb 22, 2024

- What I did

Added support for specifying build args to a package build from another file as --build-arg-file file1. You can specify multiple files as --build-arg-file file1 --build-arg-file file2 ....

This allows interesting patterns, like a build.yaml that is usable for multiple structures and versions of something (kernel builds are on my mind) while changing some build args.

linuxkit pkg build --build-yml build.yaml --build-arg-file build-args-1 ./pkg/foo
linuxkit pkg build --build-yml build.yaml --build-arg-file build-args-2 ./pkg/foo

Or if you want to get kernel-specific:

linuxkit pkg build --build-yml build-kernel.yaml --build-arg-file build-args-6.6.x ./kernel
linuxkit pkg build --build-yml build-kernel.yaml --build-arg-file build-args-5.15.x ./kernel
linuxkit pkg build --build-yml build-kernel.yaml --build-arg-file build-args-6.6.x --build-arg-file build-args-debug ./kernel

It fits very well with the linuxkit philosophy, as everything still is in files, and can be tracked via VCS.

In theory, I could have achieved the same result by allowing stacking of build.yml files, but that is messy to do. Maybe in the future.

I added tests, of course.

- How I did it

Writing code. Writing tests. Happy they pass.

- How to verify it

CI

- Description for the changelog

Support for multiple build-args files

Signed-off-by: Avi Deitcher <avi@deitcher.net>
@deitch deitch merged commit 36f379a into linuxkit:master Feb 22, 2024
22 checks passed
@deitch deitch deleted the build-arg-file branch February 22, 2024 15:24
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.

None yet

1 participant