title: Setting arguments in docker-compose file
body: <p>Hi I want to use the haproxy exporter provided here <a href="https://github.com/prometheus/haproxy_exporter" rel="nofollow">https://github.com/prometheus/haproxy_exporter</a> in a docker container.</p>
  
  <p>I am using <code>docker-compose</code>for managing containers and want to recreate this command:</p>
  
  <pre><code>$ docker run -p 9101:9101 prom/haproxy-exporter -haproxy.scrape-uri="http://user:pass@haproxy.example.com/haproxy?stats;csv"
  </code></pre>
  
  <p>in my docker-compose.yml.</p>
  
  <p>I am not sure how to pass the argument, after viewing the docker-compose documentation I tried it like this:</p>
  
  <pre><code>  haproxy-exporter:
      image: prom/haproxy-exporter
      ports:
        - 9101:9101
      network_mode: "host"
      build:
        args:
          - haproxy.scrape-uri="http://user:pass@haproxy.example.com/haproxy?stats;csv"
  </code></pre>
  
  <p>But this gives me an <code>file is invalid</code> message because it requires a context with a build.</p>
  
  <p>Thanks for any help in advance</p>