commit 1e326a68a9aaa93c284a1d06f699406bd5cd779c Author: dave Date: Sun Sep 20 12:59:34 2015 -0700 initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dd3e413 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu:trusty + +RUN apt-get update ;\ + apt-get install -y curl openjdk-7-jre-headless supervisor ;\ + mkdir /opt/kibana ;\ + curl -o /tmp/kibana4.tar.gz https://download.elastic.co/kibana/kibana/kibana-4.1.2-linux-x64.tar.gz ;\ + tar -C /opt/kibana/ -zxvf /tmp/kibana4.tar.gz --strip-components=1 ;\ + rm /tmp/kibana4.tar.gz ;\ + useradd kibana ;\ + rm -rf /var/lib/apt/lists/* + +ADD start /start +ADD kibana.conf /etc/supervisor/conf.d/kibana.conf +ADD supervisor.conf /etc/supervisor/conf.d/supervisor.conf + +ENTRYPOINT ["/start"] +EXPOSE 5601 diff --git a/README.md b/README.md new file mode 100644 index 0000000..a54ad88 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +docker-kibana +============= + +Container for running [Kibana](https://www.elastic.co/products/kibana). + +*Usage:* + +* Build: `docker build -t kibana .` +* Run: `docker run -d -p 5601:5601 kibana` + +*Extras:* + +* Set elasticsearch hostname: `-e ELASTICSEARCH_HOSTNAME="192.168.31.11:9200"` +* Set kibana port: `-e KIBANA_PORT="1234"` diff --git a/kibana.conf b/kibana.conf new file mode 100644 index 0000000..e525724 --- /dev/null +++ b/kibana.conf @@ -0,0 +1,5 @@ +[program:kibana] +command=/opt/kibana/bin/kibana +user=kibana +redirect_stderr=true +directory=/opt/kibana \ No newline at end of file diff --git a/start b/start new file mode 100755 index 0000000..14d8757 --- /dev/null +++ b/start @@ -0,0 +1,14 @@ +#!/bin/bash + +# Cleanly kill supervisor when container is stopped +trap 'kill $(jobs -p)' EXIT + +if [ "$ELASTICSEARCH_HOSTNAME" != "" ]; then + sed -i -r "s/^elasticsearch_url: .+/elasticsearch_url: \"http:\/\/${ELASTICSEARCH_HOSTNAME}\/\"/" /opt/kibana/config/kibana.yml +fi + +if [ "$KIBANA_PORT" != "" ]; then + sed -i -r "s/^port: .+/port: $KIBANA_PORT/" /opt/kibana/config/kibana.yml +fi + +supervisord diff --git a/supervisor.conf b/supervisor.conf new file mode 100644 index 0000000..54296b8 --- /dev/null +++ b/supervisor.conf @@ -0,0 +1,2 @@ +[supervisord] +nodaemon=true