Skip to content

Commit

Permalink
reordered instructions in Dockerfile to reduce image size
Browse files Browse the repository at this point in the history
(shaved 184 MB off the image size)
  • Loading branch information
spujadas committed Jul 20, 2015
1 parent 462fa9c commit b59eaef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ ENV LOGSTASH_PACKAGE logstash-1.5.2.tar.gz
RUN mkdir ${LOGSTASH_HOME} \
&& curl -O https://download.elasticsearch.org/logstash/logstash/${LOGSTASH_PACKAGE} \
&& tar xzf ${LOGSTASH_PACKAGE} -C ${LOGSTASH_HOME} --strip-components=1 \
&& rm -f ${LOGSTASH_PACKAGE}

ADD ./logstash-init /etc/init.d/logstash
RUN sed -i -e 's#^LS_HOME=$#LS_HOME='$LOGSTASH_HOME'#' /etc/init.d/logstash \
&& chmod +x /etc/init.d/logstash \
&& rm -f ${LOGSTASH_PACKAGE} \
&& groupadd -r logstash \
&& useradd -r -s /usr/sbin/nologin -d ${LOGSTASH_HOME} -c "Logstash service user" -g logstash logstash \
&& chown -R logstash:logstash ${LOGSTASH_HOME} \
&& mkdir -p /var/log/logstash /etc/logstash/conf.d

ADD ./logstash-init /etc/init.d/logstash
RUN sed -i -e 's#^LS_HOME=$#LS_HOME='$LOGSTASH_HOME'#' /etc/init.d/logstash \
&& chmod +x /etc/init.d/logstash


### install Kibana

Expand All @@ -57,15 +57,15 @@ ENV KIBANA_PACKAGE kibana-4.1.1-linux-x64.tar.gz
RUN mkdir ${KIBANA_HOME} \
&& curl -O https://download.elasticsearch.org/kibana/kibana/${KIBANA_PACKAGE} \
&& tar xzf ${KIBANA_PACKAGE} -C ${KIBANA_HOME} --strip-components=1 \
&& rm -f ${KIBANA_PACKAGE}

ADD ./kibana-init /etc/init.d/kibana
RUN sed -i -e 's#^KIBANA_HOME=$#KIBANA_HOME='$KIBANA_HOME'#' /etc/init.d/kibana \
&& chmod +x /etc/init.d/kibana \
&& rm -f ${KIBANA_PACKAGE} \
&& groupadd -r kibana \
&& useradd -r -s /usr/sbin/nologin -d ${KIBANA_HOME} -c "Kibana service user" -g kibana kibana \
&& chown -R kibana:kibana ${KIBANA_HOME}

ADD ./kibana-init /etc/init.d/kibana
RUN sed -i -e 's#^KIBANA_HOME=$#KIBANA_HOME='$KIBANA_HOME'#' /etc/init.d/kibana \
&& chmod +x /etc/init.d/kibana


###############################################################################
# CONFIGURATION
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Elasticsearch, Logstash, Kibana (ELK) Docker image

[![](https://badge.imagelayers.io/sebp/elk:latest.svg)](https://imagelayers.io/?images=sebp/elk:latest 'Get your own badge on imagelayers.io')

This Docker image provides a convenient centralised log server and log management web interface, by packaging [Elasticsearch](http://www.elasticsearch.org/) (version 1.7.0), [Logstash](http://logstash.net/) (version 1.5.2), and [Kibana](http://www.elasticsearch.org/overview/kibana/) (version 4.1.1), collectively known as ELK.

### Contents ###
Expand Down Expand Up @@ -29,8 +31,6 @@ To pull this image from the [Docker registry](https://registry.hub.docker.com/u/

**Note** – This image has been built automatically from the source files in the [source Git repository on GitHub](https://github.com/spujadas/elk-docker). If you want to build the image yourself, see the *[Building the image](#building-image)* section below.

**Note** – The size of the virtual image (as reported by `docker images`) is 1,091 MB.

## Usage <a name="usage"></a>

Run the container from the image with the following command:
Expand Down

0 comments on commit b59eaef

Please sign in to comment.