title: Setting docker env var from build secret
body: <p>Is there a way to set environment variables from the new docker <a href="https://docs.docker.com/develop/develop-images/build_enhancements/" rel="noreferrer">build enhancements</a>? </p>
  
  <p>Have tried </p>
  
  <pre><code>RUN --mount=type=secret,id=secret export SECRET=`/run/secrets/secret
  RUN --mount=type=secret,id=secret ENV SECRET=`/run/secrets/secret
  </code></pre>
  
  <p>Both doesn't work. Or is setting secrets on environment variables on dockerfile bad? Since running <code>docker history</code> to the env var being set in plain text. If that's the case, what's the best way to set the env var as secured as possible?</p>