title: Docker certificates with volume
body: <p>I need to share my docker machine certs with container, so I used volume for it. Unfortunately it seems doesn't work as I expected because container doesn't find this files. </p>
  
  <p>It's problem existing on my linux (Ubuntu) machine. On my macOS system everything looks fine. My approach works correctly and the file exists. I tried to modify path but it wasn't help. </p>
  
  <p>start-service.sh</p>
  
  <pre><code>docker build -t api-gateway-service .
  docker run --name api-gateway-service -v /&lt;absolute path to .docker&gt;/machine/machines/manager1:/certs --net='host' --env-file env -d api-gateway-service
  </code></pre>
  
  <p>env</p>
  
  <pre><code>DOCKER_CERT_PATH=/certs
  </code></pre>
  
  <p>config.js</p>
  
  <pre class="lang-js prettyprint-override"><code>
  const certDir = process.env.DOCKER_CERT_PATH
  
  const dockerSettings = {
    protocol: 'https',
    host: machine.substr(machine.indexOf(':', 0) + 3, machine.indexOf(':', 6) - 6),
    port: parseInt(machine.substr(-4), 10),
    checkServerIdentity: false,
    ca: fs.readFileSync(certDir + '/ca.pem'),
    cert: fs.readFileSync(certDir + '/cert.pem'),
    key: fs.readFileSync(certDir + '/key.pem'),
    version: 'v1.25'
  }
  
  </code></pre>
  
  <p>I created container and application trying to get certs from mounted volume. But then throws error with "Error: ENOENT: no such file or directory, open '/certs/ca.pem'" so something went wrong with it.</p>