Setting arguments in docker-compose file

Hi I want to use the haproxy exporter provided here in a docker container.

I am using docker-composefor managing containers and want to recreate this command:

  • Running 'docker-compose up' raises “No module named fnctl” error on Windows
  • Explanation about Supervisor and tail over Apache's error.log
  • Unable to connect Vagrant machine to bridged network
  • Everything inside one docker container or specialized containers
  • Automatic self-configuration of an etcd cluster as a Docker swarm service
  • Sharing docker registry images among gcloud projects
  • $ docker run -p 9101:9101 prom/haproxy-exporter -haproxy.scrape-uri=";csv"

    in my docker-compose.yml.

    I am not sure how to pass the argument, after viewing the docker-compose documentation I tried it like this:

        image: prom/haproxy-exporter
          - 9101:9101
        network_mode: "host"
            - haproxy.scrape-uri=";csv"

    But this gives me an file is invalid message because it requires a context with a build.

    Thanks for any help in advance

  • launch a CAT command unix into Dockerfile
  • Storm:java.lang.RuntimeException: Returned channel was actually not established
  • Can I release some memory of a running Docker container on the fly?
  • Mariadb-10.0 install fails in boot2docker with “policy-rc.d denied execution” but works in Docker
  • How to access lower layer files in docker?
  • Strange behaviour mounting Windows drive in docker container
  • One Solution collect form web for “Setting arguments in docker-compose file”

    The image is already built and pulled from the hub (unless you have your own Dockerfile) so you don’t need the build option. Instead, pass your arguments as the command since the image appears to use an entrypoint (if their Dockerfile only had a cmd option, then you’d need to also pass /bin/haproxy-exporter in your command):

        image: prom/haproxy-exporter
          - 9101:9101
        network_mode: "host"
        command: -haproxy.scrape-uri=";csv"
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.