title: Docker Secrets ASP.NET Core
body: <p>I want to access Docker Secrets in my ASP.Net Core project.</p>
  
  <p>I distilled the issue down to a test API project. All it does is read the directories inside <code>/run/</code></p>
  
  <pre><code>[HttpGet]
  public IEnumerable&lt;string&gt; Get()
  {
    return Directory.GetDirectories("/run");
  }
  </code></pre>
  
  <p>I changed the compose files to <strong>3.1</strong> and added the plumbing for secrets listed here: <a href="https://stackoverflow.com/questions/42139605/how-do-you-manage-secret-values-with-docker-compose-v3-1/42151570">how do you manage secret values with docker-compose v3.1?</a></p>
  
  <pre><code>version: '3.1'
  
  services:
    secrettest:
      image: secrettest
      build:
        context: ./SecretTest
        dockerfile: Dockerfile
      secrets:                    # secrets block only for 'web' service
       - my_external_secret
  
  secrets:                        # top level secrets block
    my_external_secret:
      external: true
  </code></pre>
  
  <p>The get action returns <strong>["/run/lock"]</strong>. I do not see a <strong>/run/secrets</strong> directory. I also shelled into the container to verify it does not see the <strong>/run/secrets</strong> directory.</p>
  
  <p>I am able to see secrets from other containers. Anyone know what I am missing? Is there another strategy I should take other than the 3.1 compose to configure the container in VS 2017?</p>