title: Mount a volume in docker-compose. How is it done?
body: <p>If I execute this cmd in a console:</p>
  
  <pre><code> docker run -it --rm --link rabbit --link elasticsearch -v "$PWD"/logstash:/config-dir logstash logstash -f /config-dir/logstash.conf
  </code></pre>
  
  <p>It runs fine. Inside ./logstash folder there is a logstash.conf.
  But now I'm trying to put in a docker-compose and the same doesn't works:</p>
  
  <pre><code>  logstash:
    image: logstash:latest
    links:
      - "elasticsearch:elasticsearch"
      - "rabbit:rabbit"
    volumes:
        - $PWD/logstash:/config_dir
    command:
      - "-f /config_dir/logstash.conf"
  </code></pre>
  
  <p>But I cannot see the difference between both commands. Some help? How is it volume mounting done? Or is the command that doesn't works? Response from logstash init is:</p>
  
  <pre><code>logstash_1        | {:timestamp=&gt;"2016-07-06T15:43:06.663000+0000", :message=&gt;"No config files found: / /config_dir/logstash.conf\nCan you make sure this path is a logstash config file?", :level=&gt;:error}
  rabbitmq_logstash_1 exited with code 1
  </code></pre>
  
  <p><strong>Edit:</strong> I finally solved the problem by removing the command and using the default command of the original image, but I still don't understand the problem and how the same command is passed to docker and works but if it is passed throught docker-compose don't.
  Thanks in advance</p>