Search code examples
elasticsearchdockerkibanakibana-4

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?


Solution

  • 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/kibanadevdb/elasticsearchabh1nav/java7abh1nav/baseimagephusion/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