title: java running inside docker container cannot see environment variables
body: <p>I am new with Docker. I have a small Java application that I am trying to run inside Docker. I have created a <em>Dockerfile</em> to build the image.</p>
  
  <p>My application is reading Environment Variables to know which database to connect to.</p>
  
  <p>When running the command</p>
  
  <pre><code>docker run -d -p 80:80 occm -e "MYSQL_USER=user" -e "MYSQL_PASSWORD=password" -e "MYSQL_PORT=3306" -e "MYSQL_HOST=somehost"
  </code></pre>
  
  <p>and then enumerating all the variables using <code>System.getenv</code>, I dont see any of them. So I have added to the Docker file</p>
  
  <pre><code>ENV MYSQL_HOST=localhost
  </code></pre>
  
  <p>now when I run the container I see this variable, but I see it with the <code>localhost</code> value and not <code>somehost</code>.</p>
  
  <p>What am I doing wrong?</p>