I'm trying to use the target host's env variable to parametrize my container when launching it with the remote API, but none of these worked ...
"Env": [
"ENV_VAR=`$TEST`",
"ENV_VAR2=$TEST"
],
Does anyone have an idea how to achieve this ?
If
$TESTis an environment variable from the host, thepayload.jsonneeds to include its value, not$TEST, as thePOSTwill not change/interpret$TEST(but pass it literally).If, instead of using a
payload.jsonfile, you used a command with the json directly in it, you could wrap the json part between double quotes: then$TESTwould be interpreted by the shell.See "How to include environment variable in bash line CURL?"