From a8be84ea73323d60d7f58763ae90d43032bb8fa7 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 28 Dec 2013 09:14:49 -0800 Subject: [PATCH] kibana: Add a Kibana image Dump a Kibana tarball into Nginx's htdocs, and use an ELASTICSEARCH_URL environment variable to adjust config.js at spin-up. List Kibana after Nginx in build.sh's REPOS to ensure the Nginx image is built first. --- README.md | 1 + build.sh | 1 + kibana/Dockerfile.template | 33 +++++++++++++++++++++++++++++++++ kibana/README.md | 5 +++++ 4 files changed, 40 insertions(+) create mode 100644 kibana/Dockerfile.template create mode 100644 kibana/README.md diff --git a/README.md b/README.md index c4956e7..77f6516 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ The dependency graph is: `-- gentoo-syslog (adds syslog-ng and associates) |-- buildbot (adds a Buildbot master and slave) |-- nginx (adds Nginx) + | `-- kibana (adds Kibana) |-- postgresql (adds PostgreSQL) |-- redis (adds Redis) |-- stunnel (adds stunnel) diff --git a/build.sh b/build.sh index 938d9c8..55dcbb3 100755 --- a/build.sh +++ b/build.sh @@ -45,6 +45,7 @@ REPOS="${REPOS:- buildbot elasticsearch nginx + kibana postgresql redis stunnel diff --git a/kibana/Dockerfile.template b/kibana/Dockerfile.template new file mode 100644 index 0000000..d335dfa --- /dev/null +++ b/kibana/Dockerfile.template @@ -0,0 +1,33 @@ +# Copyright (C) 2013 W. Trevor King +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +FROM NAMESPACE/nginx:TAG +MAINTAINER A. U. Thor +#VOLUME ["PORTAGE:/usr/portage:ro", "PORTAGE/distfiles:/usr/portage/distfiles:rw"] +RUN wget https://download.elasticsearch.org/kibana/kibana/kibana-3.0.0milestone4.tar.gz +RUN tar -xvf kibana-3.0.0milestone4.tar.gz --strip-components 1 -C /var/www/localhost/htdocs +RUN sed -i 's|"http://"+window.location.hostname+":9200"|"ELASTICSEARCH_URL"|' /var/www/localhost/htdocs/config.js + +CMD sed -i "s|ELASTICSEARCH_URL|${ELASTICSEARCH_URL}|" /var/www/localhost/htdocs/config.js && rc default && tail -F /var/log/messages +EXPOSE 80 diff --git a/kibana/README.md b/kibana/README.md new file mode 100644 index 0000000..57cdf12 --- /dev/null +++ b/kibana/README.md @@ -0,0 +1,5 @@ +Run this [Kibana][] image with: + + $ docker run -d -name kibana-0 -e ELASTICSEARCH_URL=http://es.example.com:9200 -p 80:80 wking/kibana + +[Kibana]: http://www.elasticsearch.org/overview/kibana/ -- 2.26.2