How to provide the `--build-arg` flag to the local-kubernetes provider?

My images require the --build-arg flag to provide credentials for private package registries and similar usage, and I have been able to make these work for the kubernetes provider with kaniko just fine, but the docs do not mention how to do it for the local-kubernetes provider using local-docker.

Is it possible? If so, how do I inject such parameter?

Hey @guhcampos! Thanks for flagging this to us, I’ll have our engineers take a look at this and update our docs following on from that

Hi @guhcampos ,
So what you can do is create a container module just to build your image and add your buildArgs there. Assuming this is your Dockerfile:

ARG BASE_IMAGE_VERSION=${BASE_IMAGE_VERSION}
FROM nginx:${BASE_IMAGE_VERSION}

And this would be your container module to build the image.

kind: Module
type: container
name: build-my-container
buildArgs:
  BASE_IMAGE_VERSION: 1.21.1

If you want to deploy the resulting image with a kubernetes module, you can add the build-my-container module as a dependency to that module and reference the image tag with ${modules.build-my-image.outputs.deployment-image-id}. If you you’d prefer a more complete example of how to use the kubernetes (or helm) module in connection with the container module to build your image, just let me know :slight_smile:
Hope this was helpful to you, let me know how it goes.
Best,
Anna