title: How to share local files to docker container In swarm with docker-compose
body: <p>here is my docker compose file </p>
  
  <pre><code>version: '2'
  services:
   demoui:
    image: demoimage
    ports:
     - "80:8000"
    volumes:
     - ./democonfig/config.js:/usr/local/tomcat/webapps/demo-ui/config.js
     - ./logs/demo-ui:/usr/local/tomcat/logs
    restart: unless-stopped
  </code></pre>
  
  <p>This docker compose file works when I was in single node. After moving to docker swarm . It is not working. It throws the following error</p>
  
  <pre><code>ERROR: for demoui  Error response from daemon: rpc error: code = 2 desc = "oci runtime error: could not synchronise with container process: not a directory"
  Traceback (most recent call last):
    File "&lt;string&gt;", line 3, in &lt;module&gt;
    File "compose/cli/main.py", line 63, in main
  AttributeError: 'ProjectError' object has no attribute 'msg'
  docker-compose returned -1
  </code></pre>
  
  <p>So the questions are</p>
  
  <ol>
  <li><p>How to share file to swarm cluster ?</p></li>
  <li><p>Or need to copy all file into image and run it?</p></li>
  <li><p>Please share some documentation of docker volume with swarm.</p></li>
  </ol>