Docker environmental variables from a file
<p>I am trying to use one Dockerfile for both my production and development. The only difference between the production and development are the environment variables I set. Therefore I would like someway import the environment variables from a file. Before using Docker I would simply do the following</p>

<pre><code>. ./setvars
./main.py
</code></pre>

<p>However if change <code>./main.py</code> with the Docker equivalent</p>

<pre><code>. ./setvars
docker run .... ./main.py
</code></pre>

<p>then the variables will be on the host and not accessible from the Docker instance. Of course a quick and dirty hack would be to make a file with</p>

<pre><code>#!/bin/bash
. ./setvars
./main.py
</code></pre>

<p>and run that in the instance. That would however be really annoying, since I got lots of scripts I would like to run (with the same environment variables), and would then have to create a extra script for everyone of those.</p>

<p>Are there any other solution to get my environment variables inside docker without using a different Dockerfile and the method I described above?</p>