title: Setting environment variables when running docker in detached mode
body: <p>If I include the following line in /root/.bashrc:</p>
  
  <pre><code>export $A = "AAA"
  </code></pre>
  
  <p>then when I run the docker container in interactive mode (docker run -i), the $A variable keeps its value. However if I run the container in detached mode I cannot access the variable. Even if I run the container explicitly sourcing the .bashrc like</p>
  
  <pre><code>docker run -d my_image /bin/bash -c "cd /root &amp;&amp; source .bashrc &amp;&amp; echo $A"
  </code></pre>
  
  <p>such line produces an empty output.</p>
  
  <p>So, why is this happening? And how can I set the environment variables defined in the .bashrc file?</p>
  
  <p>Any help would be very much appreciated!</p>