Docker Community Forums

Share and learn in the Docker community.

Docker not getting CommandLine Environment variables


(Kaleeswaran Narayanan) #1

We had invoked 10 instance ( containers ) at the same time in our centos 7 machine. Facing issues like environmental variables not resolved an container out of 10 instances. The command which was i executed is given below :-

sudo docker run -t --name=ZOHOMAIL_586803 -m=16g --cpuset=0-48 -e ANT_HOME=/usr/ant/apache-ant-1.8.1 -e JAVA_HOME=/usr/java/jdk1.7.0_25 -e JAVA_TOOL_OPTIONS=-Dfile.encoding=utf-8 -e PATH=/usr/java/jdk1.7.0_25/bin:/usr/ant/apache-ant-1.8.1/bin/:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/bin:/etc/ansible_downloads/nvm/v0.10.25/bin: -v /etc/localtime:/etc/localtime:ro cmtools.csez.zohocorpin.com:5000/zohomail/zohomail_integ_branch

In the above command, ANT_HOME is not getting inside an container.

Your suggestions is highly appreciated.

Thanks,
Kali Sastha …


(Jerry Baker) #2

Hi Kali,

Does it work if you add double quotes around the path? - ANT_HOME="/usr/ant/apache-ant-1.8.1"

Jerry


(Kaleeswaran Narayanan) #3

Thank you @kizbitz Jerry. It’s working fine now.
My question is how remaining contianers known the value of ANT_HOME without enclosed within the double quotes …? Please clarify my doubt’s, if it is possible .

Your suggestions is highly appreciated.

Thanks,
Kali Sastha…