unix envsubst not picking local environment variables inside docker

93 views Asked by At

I've for a standard linux docker container that sets some environment variable E1=60 and installs a file myfile which is simply the line:

this is ${E1}

then runs the following script at container startup time:

#!/bin/sh
E1=80
export E1=80
cat myfile | envsubst

the output is:

this is 60

instead of:

this is 80

How do I make envsubst pick up my local/exported E1=80 variable?

1

There are 1 answers

0
Sagi Mann On

resolved, the issue was that there was a previous script that substituted empty vars (which I wasn't aware of) and therefore, my envsubst calls didn't find them