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-args #3547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

deitch
Copy link
Collaborator

@deitch deitch commented Aug 31, 2020

Signed-off-by: Avi Deitcher avi@deitcher.net

- What I did

Added support for --build-arg to lkt pkg build, passing them on to docker build --build-arg

- How I did it

Added the command option to the pkg build flagSet, and then creating WithBuildArg() options

- How to verify it

Run it with and without the --build-arg

- Description for the changelog

Support for --build-arg

Signed-off-by: Avi Deitcher <avi@deitcher.net>
@rn
Copy link
Member

rn commented Sep 1, 2020

One of the key concepts behind the linuxkit package is that the build entirely depends on files checked into a git repository (with the git commit and repository being recorded in the package meta-data) and signed files from docker hub for the build. The tag of the resultant image is actually the content hash of all the bits which were used to build the image (source and dockerfile with the dockerfile containing the explicit version of the image used to build the image). This PR seems to add the ability to change the build based on command line arguments passed into the build which is a) not recorded and b) does not change the tag.

@deitch
Copy link
Collaborator Author

deitch commented Sep 2, 2020

Correct. We (you and I and some others) had discussed this verbally a while back. I wanted to raise the discussion again.

This really has its roots in the docker build debate (years ago) about whether or not to include --build-arg for roughly the same reason. If I recall correctly, they ended up including it because practically won. It was just too necessary. Without it, you end up doing some really convoluted things that don't end up helping, like having a template file for the dockerfile checked in, adding the dockerfile to gitignore, and then generating the dockerfile separately prior to running lkt pkg build.

At a certain point we end up running against what people practically need to do.

I'm coming down (obviously) on the docker-historical side of needing build args - in the end, lkt pkg build is just a fancy wrapper around docker build - but I would like to have the conversation here.

@deitch
Copy link
Collaborator Author

deitch commented Apr 17, 2023

I want to reopen this discussion. I have had several conversations over the years (including recently) where people ask, "how do I pass build args?" When the response is, "you cannot other than in the build.yaml, they do things like described above: make build.yaml.in, check that into git, then generate build.yaml (which is in .gitignore) and wrap our lkt build with their own make magic or similar.

Are we at the point where we should support it? Or maybe at least a build args file (like an env file)? Let users decide whether or not to check that in?

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

2 participants