title: How to read external secrets when using docker-compose
body: <p>I wonder how can i pass external secrets into services spawned by docker-compose. I do the following:</p>
  
  <p>I create new secret</p>
  
  <pre><code>printf "some secret value goes here" | docker secret create wallet_password -
  </code></pre>
  
  <p>My docker-compose.yml:</p>
  
  <pre><code>version: "3.4"
  services:
    test:
      image: alpine
      command: 'cat /run/secrets/wallet_password'
      secrets: 
      - wallet_password
  
  secrets:
    wallet_password:
      external: true
  </code></pre>
  
  <p>Then I run:</p>
  
  <pre><code>docker-compose -f services/debug/docker-compose.yml up -d --build
  </code></pre>
  
  <p>and</p>
  
  <pre><code>docker-compose -f services/debug/docker-compose.yml up
  </code></pre>
  
  <p>I get the following response:</p>
  
  <pre><code>WARNING: Service "test" uses secret "wallet_password" which is external. External secrets are not available to containers created by docker-compose.
  WARNING: The Docker Engine you're using is running in swarm mode.
  
  Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.
  
  To deploy your application across the swarm, use `docker stack deploy`.
  
  Starting debug_test_1 ...
  Starting debug_test_1 ... done
  Attaching to debug_test_1
  test_1  | cat: can't open '/run/secrets/wallet_password': No such file or directory
  </code></pre>
  
  <p>Sooo.... is there any way of passing external secret into container spawned by docker-compose?</p>