kaniko
kaniko copied to clipboard
Is there a way to populate ARG from kaniko-executor's environment?
Hi,
is there a way to populate the Dockerfile's ARGs (or ENVs at this point) from the environment present at kaniko's executor build time?
I would like to avoid writing a bash-loop to generate --build-arg FOO=$FOO
statements to feed these into the executor's cmdline if possible.
@f0o currently there is now way. Maybe we could support it somewhere here to auto add build args from env variables. https://github.com/GoogleContainerTools/kaniko/blob/9f4fead7b52df63c28761137dd2c3a8c07bf74d5/pkg/commands/add.go#L48
+1 Also would like this to be standard behavior
+1 Repeating build args for very env var is unnecessary boilerplate and can actually break things.
I am looking for this or similar feature as well
+1
+1
as a temporary workaround i auto-generate those --build-arg arguments - e.g. from .env file, but would also work for system env vars:
$(grep '^[^#]' .env | sed 's/.*/--build-arg &/' | xargs)
+1
+1
+1
+1
Bump this
Bump