title: docker stack: setting environment variable from secrets
body: <p>I was trying to set the password from secrets but it wasn't picking it up. 
  Docker Server verions is 17.06.2-ce. I used the below command to set the secret:</p>
  
  <pre><code>echo "abcd" | docker secret create password -
  </code></pre>
  
  <p>My docker compose yml file looks like this</p>
  
  <pre><code>version: '3.1'
  ...
   build:
    context: ./test
    dockerfile: Dockerfile
  environment:
    user_name: admin
    eureka_password: /run/secrets/password
  secrets:
    - password
  </code></pre>
  
  <p>I also have root secrets tag:</p>
  
  <pre><code>secrets:
    password:
       external: true
  </code></pre>
  
  <p>When I hardcode the password in environment it works but when I try via the secrets it doesn't pick up. I tried to change the compose version to 3.2 but with no luck. Any pointers are highly appreciated!</p>