title: Docker how to inject host ENV into Dockerfile ENV during build?
body: <p>I am adding some environment settings on docker repo automatic build, lets say, <code>WEBSERVER_PRIVATE_KEY=123</code></p>
  
  <p>in my Dockerfile, when I build locally, I assume it would pick up the env value</p>
  
  <pre><code>RUN echo $WEBSERVER_PRIVATE_KEY &gt; /somewhere/key
  </code></pre>
  
  <p>But it didn't work.</p>
  
  <p>I had a look at the <code>ENV</code> command, but it doesn't seem there is a way to inject that value.</p>
  
  <p>I had a look at the <code>ARG</code> command, but it requires to pass as <code>--build-arg</code> which I doubt it will work during built on docker repo.</p>
  
  <p>See below environment settings on docker repo during automatic builds, how do I make the Dockerfile to reference the <code>WEBSERVER_PRIVATE_KEY</code> in the setting.</p>
  
  <p><a href="https://i.stack.imgur.com/7frYE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7frYE.png" alt="enter image description here"></a></p>