title: {{node.hostname}} usage in docker-compose.yml in Docker swarm mode
body: <p>Hi I am looking at above example and trying to run docker swarm stack but getting below error. not sure what I am missing here.</p>
  
  <p><strong>docker-compose.yml</strong></p>
  
  <pre><code>services:
    nginx:
      image: nginx
      hostname: '{{.Node.Hostname}}'
  version: '3.3'
  </code></pre>
  
  <p>docker stack deploy test -c docker-compose.yml</p>
  
  <blockquote>
    <p>but getting below output/error : Error response from daemon: rpc
    error: code = InvalidArgument desc = expanding hostname failed:
    template: expansion:1:7: executing "expansion" at &lt;.Node.Hostname>:
    can't evaluate field Hostname in type struct { ID string }</p>
  </blockquote>
  
  <p>Here is my docker-info output:</p>
  
  <p>docker info Containers: </p>
  
  <p>12 Running: 0 Paused: 0 Stopped: 
  12 Images: 41 
  <strong>Server Version: 18.03.1-ce</strong> 
  Storage Driver: devicemapper 
  Pool Name: docker-253:1-2490377-pool Pool 
  Blocksize: 65.54kB Base 
  Device Size: 10.74GB Backing Filesystem: </p>
  
  <p>Thanks in advance.</p>