Skip to content

Instantly share code, notes, and snippets.

@dfch
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dfch/d9d527c97949312d29fe to your computer and use it in GitHub Desktop.
Save dfch/d9d527c97949312d29fe to your computer and use it in GitHub Desktop.
Graylog2 Intermediate Version Dockerfile
FROM graylog2/allinone
MAINTAINER Ronald Rink <ronald.rink@d-fens.net>
ENV GRAYLOG2_BASE_DIR /opt/graylog2
ENV GRAYLOG_SERVER_VERSION 0.93.0-SNAPSHOT-20150112150701
ENV GRAYLOG_WEB_VERSION 0.93.0-SNAPSHOT-20150112102527
RUN apt-get install -y wget tar
RUN cd /opt/ && wget http://packages.graylog2.org/nightly-builds/graylog2-${GRAYLOG_SERVER_VERSION}.tar.gz
RUN cd /opt/ && tar zxvf graylog2-${GRAYLOG_SERVER_VERSION}.tar.gz -C ${GRAYLOG2_BASE_DIR}/ --overwrite
RUN cd /opt/ && mv ${GRAYLOG2_BASE_DIR}/server ${GRAYLOG2_BASE_DIR}/server-previous
RUN cd /opt/ && mv ${GRAYLOG2_BASE_DIR}/graylog2-${GRAYLOG_SERVER_VERSION}/ ${GRAYLOG2_BASE_DIR}/server
RUN cd /opt/ && cp ${GRAYLOG2_BASE_DIR}/server/graylog2.jar ${GRAYLOG2_BASE_DIR}/server/graylog2-server.jar
# RUN cd /opt/ && mv ${GRAYLOG2_BASE_DIR}/conf/graylog2.conf ${GRAYLOG2_BASE_DIR}/conf/graylog2.conf-previous
# RUN cd /opt/ && cp ${GRAYLOG2_BASE_DIR}/server/graylog2.conf.example ${GRAYLOG2_BASE_DIR}/conf/graylog2.conf
RUN cd /opt/ && wget http://packages.graylog2.org/nightly-builds/graylog2-web-interface-${GRAYLOG_WEB_VERSION}.tgz
RUN cd /opt/ && tar zxvf graylog2-web-interface-${GRAYLOG_WEB_VERSION}.tgz -C ${GRAYLOG2_BASE_DIR}/ --overwrite
RUN cd /opt/ && mv ${GRAYLOG2_BASE_DIR}/web ${GRAYLOG2_BASE_DIR}/web-previous
RUN cd /opt/ && mv ${GRAYLOG2_BASE_DIR}/graylog2-web-interface-${GRAYLOG_WEB_VERSION}/ ${GRAYLOG2_BASE_DIR}/web
VOLUME /var/opt/graylog2/data
VOLUME /var/log/graylog2
# web interface
EXPOSE 9000
# gelf tcp
EXPOSE 12201
# gelf udp
EXPOSE 12201/udp
# rest api
EXPOSE 12900
# etcd
EXPOSE 4001
CMD /opt/graylog2/embedded/bin/runsvdir-docker & \
if [ ! -z "$GRAYLOG2_PASSWORD" ]; then graylog2-ctl set-admin-password $GRAYLOG2_PASSWORD; fi && \
if [ ! -z "$GRAYLOG2_TIMEZONE" ]; then graylog2-ctl set-timezone $GRAYLOG2_TIMEZONE; fi && \
if [ ! -z "$GRAYLOG2_SMTP_SERVER" ]; then graylog2-ctl set-email-config $GRAYLOG2_SMTP_SERVER; fi && \
if [ ! -z "$GRAYLOG2_MASTER" ]; then graylog2-ctl local-connect && graylog2-ctl set-cluster-master $GRAYLOG2_MASTER; fi && \
if [ ! -z "$GRAYLOG2_WEB" ]; then graylog2-ctl reconfigure-as-webinterface; \
elif [ ! -z "$GRAYLOG2_SERVER" ]; then graylog2-ctl reconfigure-as-backend; else \
graylog2-ctl local-connect && graylog2-ctl reconfigure; fi && \
tail -F /var/log/graylog2/server/current /var/log/graylog2/web/current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment