Closed leovct closed 8 months ago
Hey @leovct , this is a great idea! We don't have anyone else currently using build args so we're likely not going to be able to prioritize this soon, but would you be open to submitting a PR? The relevant code lives here: https://github.com/kurtosis-tech/kurtosis/blob/be97c3834e7e4513537c0ac22801afdcfced9065/container-engine-lib/lib/backend_interface/objects/image_build_spec/image_build_spec.go#L15
Hey @leovct , this is a great idea! We don't have anyone else currently using build args so we're likely not going to be able to prioritize this soon, but would you be open to submitting a PR? The relevant code lives here:
Will do once #2223 is merged :)
Hey! here's some pointers to get you started in the codebase (lmk if I can provide more detail elsewhere)
build_args need to get down to ImageBuildOptions.BuildArgs here: https://github.com/kurtosis-tech/kurtosis/blob/6245ddf4c0681cfc81021aeda0eb2e245ef5b275/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_manager.go#L1432
This function is where we actually call the docker client to build the image. The function gets called here: https://github.com/kurtosis-tech/kurtosis/blob/6245ddf4c0681cfc81021aeda0eb2e245ef5b275/core/server/api_container/server/startosis_engine/startosis_validator/images_validator.go#L118
LMK and I can provide some more direciton on navigating the types of the codebase (note: we have two representations of ImageBuildSpec (one in our Starlark engine, one in our container engine library that you'll have to add build_args to!
Thanks for the contribution!
Background & motivation
I would like to be able to pass build args (or build-time variables) to Dockerfile when building the images with
ImageBuildSpec
. This is something I can get around at the moment by executing my instructions at container startup and using environment variables, but it would be nice to have it. It could speed up the startup of devnets considerably.Desired behaviour
How important is this to you?
Nice to have; this feature would make using Kurtosis more enjoyable.
What area of the product does this pertain to?
Other: anything not covered by the above