title: Unable to access secrets from Dockerfile in GitHub Actions
body: <p>I am using the following project as a <a href="https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action" rel="nofollow noreferrer">baseline</a> to create a Docker container action.</p>
  <p>The problem that I have is that I need to be able to access my secrets inside my Dockerfile. I tried almost all the tricks that I knew.</p>
  <p>Retrieve the secret</p>
  <pre><code>RUN --mount=type=secret,id=API_ENDPOINT \
     export API_ENDPOINT=$(cat /run/secrets/API_ENDPOINT) 
  </code></pre>
  <p>Docker build is not happy because the <code>--mount option requires BuildKit</code>. I tried to set <code>DOCKER_BUILDKIT=1</code>, but I had zero success.</p>
  <p>How can I pass the secrets? I created an env var at the top of my action (global), and all the steps have complete visibility of that secret.</p>
  <pre><code>env:
    API_ENDPOINT: ${{secrets.API_ENDPOINT}}
  </code></pre>