title: How to use hostname passed as an argument in Dockerfile?
body: <p>I have similar command to create container:</p>
  
  <pre><code>docker create --name=myname \
      --publish "80:80" \
      --hostname myhostname \
      local/local
  </code></pre>
  
  <p>And would like to use hostname for generating virtual host for web server.</p>
  
  <p>I tried to used test command:</p>
  
  <pre><code>RUN touch ~/aaa-${HOSTNAME}
  </code></pre>
  
  <p>but got result: <code>aaa-719d8d68f3dc</code> but expected <code>aaa-myhostname</code>.</p>
  
  <p>So, it uses intermediate container environment variable instead of passed one.</p>