- Each
command
incontainer_command
runs in its own shell. Therefore, you can't rely on setting up environment variables before and using them later.
- Solution to this is to create a file which exports the environment variables that you want. Create this with the
files
config property and place it somewhere accessible. - Then place the commands you would want to be run by
command
in a.sh
file. In that.sh
file, source the environment variables file that was created earlier. Set thecommand
to execute the.sh
file. Make sure that the.sh
file has executable permissions set locally becausegit
syncs those.