From 1fe56af526a206fb7720654e4ed64fa38afa388e Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Tue, 29 Oct 2024 01:03:33 +0100 Subject: [PATCH] docs: Document env var lookup for --build-arg Add more documentation for the --build-arg parameter of the executor. Describe that it's possible to lookup build argument values from the environment and that this might be useful if you don't want to fiddle around with shell escaping. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index c087c6001..61badf677 100644 --- a/README.md +++ b/README.md @@ -806,6 +806,18 @@ export IFS='' /kaniko/executor --build-arg "MY_VAR='value with spaces'" ... ``` +It is also possible to lookup the build argument value from the environment +variables which is especially useful when you already have the build argument +value in the environment variables and don't want to fiddle around with shell escaping. +To use an environment variable as build argument value, you just need to +use the `--build-arg` parameter just with the name of the argument: + +```bash +/kaniko/executor --build-arg "MY_VAR" ... +``` +In this example, Kaniko will then set the build argument `MY_VAR` to the value of the environment +variable `MY_VAR`. + #### Flag `--cache` Set this flag as `--cache=true` to opt into caching with kaniko.