Passing Elasticsearch and Kibana config file to docker containers

I have found a docker image devdb/kibana which runs Elasticsearch 1.5.2 and Kibana 4.0.2. However I would like to pass into this docker container the configuration files for both Elasticsearch (i.e elasticsearch.yml) and Kibana (i.e config.js)

Can I do that with this image itself? Or for that would I have to build a separate docker container?

  • Why is git clone failing when I build an image from a dockerfile?
  • Dockerized gitlab use host docker to CI
  • Docker swarm: guarantee high availability after restart
  • how does docker handle file creation?
  • How to show the ID of the oldest running docker container?
  • How to create a docker container with more than 50G storage
  • multiple eth configuration using docker
  • Unable to build docker image, “must be a root user”
  • Does docker swarm mode (docker 1.13 & compose v3) really provides zero downtime rolling updates or deployments?
  • Docker: Can I access to system files?
  • Inspect non-daemon Docker container, after it has completed running
  • JVM memory settings in docker container in AWS beanstalk
  • One Solution collect form web for “Passing Elasticsearch and Kibana config file to docker containers”

    Can I do that with this image itself?

    yes, just use Docker volumes to pass in your own config files

    Let say you have the following files on your docker host:

    • /home/liv2hak/elasticsearch.yml
    • /home/liv2hak/kibana.yml

    you can then start your container with:

    docker run -d --name kibana -p 5601:5601 -p 9200:9200 \
        -v /home/liv2hak/elasticsearch.yml:/opt/elasticsearch/config/elasticsearch.yml \
        -v /home/liv2hak/kibana.yml:/opt/kibana/config/kibana.yml \
        devdb/kibana
    

    I was able to figure this out by looking at your image Dockerfile parents which are: devdb/kibana→devdb/elasticsearch→abh1nav/java7→abh1nav/baseimage→phusion/baseimage
    and also taking a peek into a devdb/kibana container: docker run --rm -it devdb/kibana find /opt -type f -name *.yml.


    Or for that would I have to build a separate docker container?

    I assume you mean build a separate docker image?. That would also work, for instance the following Dockerfile would do that:

    FROM devdb/kibana
    COPY elasticsearch.yml /opt/elasticsearch/config/elasticsearch.yml
    COPY kibana.yml /opt/kibana/config/kibana.yml
    

    Now build the image: docker build -t liv2hak/kibana .

    And run it: docker run -d --name kibana -p 5601:5601 -p 9200:9200 liv2hak/kibana

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.