3

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?

Thomasleveil
  • 95,867
  • 15
  • 119
  • 113
liv2hak
  • 14,472
  • 53
  • 157
  • 270

1 Answers1

9

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

Thomasleveil
  • 95,867
  • 15
  • 119
  • 113
  • I found another issue.I tring opening http://docker_ip:5601 - it said webpage not available connection refused after I run sudo docker run -d devdb/kibana. Is there anythong else that I need to do? port mapping perhaps? – liv2hak Jun 18 '15 at 23:17
  • 1
    that should then be another question – Thomasleveil Jun 18 '15 at 23:18
  • Will the single image create restriction on my ability to create elasticsearch cluster later if I wanted to? – liv2hak Jun 18 '15 at 23:30
  • 1
    I'm not sure you understand what you are asking. Do you mean _single container_? Docker images aren't run, they are containers blueprints from which you can run multiple containers. – Thomasleveil Jun 18 '15 at 23:32
  • I guess what I am asking is if I were to run multiple containers will it produce two Kibana and two ElasticSearch. I am looking for an elasticsearch cluster talking to the same kibana – liv2hak Jun 18 '15 at 23:34
  • 1
    see http://stackoverflow.com/questions/28632977/elasticsearch-in-docker-container-cluster – Thomasleveil Jun 18 '15 at 23:37
  • I think I may be missing something. My concern is because ES + Kibana are part of the same container. I understand the part about how to cluster elasticsearch instances. – liv2hak Jun 18 '15 at 23:40