title: set docker container env from daemon configuration file
body: <p><strong>Question</strong>: Is it possible to set docker container env from docker daemon configuration file?</p>
  
  <p>When run a container, we can use <code>-e</code> flag to set specific environment variables inside container, such as <code>docker run -e foo=bar</code>.</p>
  
  <p>But is it possible to configure docker daemon file such as <code>/etc/default/docker</code> or <code>/etc/sysconfig/docker</code>, then every docker container can has same env <code>foo=bar</code> instead of use <code>-e</code> flag.</p>
  
  <pre><code>[root@i-7guzl6d7 ~]# cat /etc/sysconfig/docker
  # Docker Upstart and SysVinit configuration file
  
  # Customize location of Docker binary (especially for development testing).
  #DOCKER="/usr/local/bin/docker"
  
  # Use DOCKER_OPTS to modify the daemon startup options.
  #DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
  
  # If you need Docker to use an HTTP proxy, it can also be specified here.
  #export http_proxy="http://127.0.0.1:3128/"
  
  # This is also a handy place to tweak where Docker's temporary files go.
  #export TMPDIR="/mnt/bigdrive/docker-tmp"
  
  # Set container environment here?
  # export FOO=BAR
  </code></pre>