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/4a94ca6bfc339c6594a2 to your computer and use it in GitHub Desktop.
Save dfch/4a94ca6bfc339c6594a2 to your computer and use it in GitHub Desktop.
Graylog2 Plugin Test Dockerfile
# Dockerfile to build Graylog2/allinone and d-fens Plugins
#
# Copyright 2015 Ronald Rink, d-fens GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Based on the Dockerfile by Torch GmbH, http://torch.sh
# Copyright 2015, Torch GmbH
#
# Build the container
# cd <path to Dockerfile>
# sudo docker build -t dfch/dfchgraylog2plugins-1.0.0 .
#
# Run a container using the built image
# sudo docker run -d -i -p 9443:9443 -t --name gl2 dfch/dfchgraylog2plugins-1.0.0
#
# Login to the running container
# sudo docker attach gl2
#
# Exit from a attached container
# ^p^q (Ctrl+p and Ctrl+q)
#
# Use Graylog2 base image
FROM graylog2/allinone
# Maintainer
MAINTAINER Ronald Rink <ronald.rink@d-fens.net>
# get required packages
RUN apt-get install -y wget
# execscript alarm plugin
RUN cd /opt/graylog2/plugin && wget -q --no-check-certificate --no-cookies https://drone.io/github.com/dfch/biz.dfch.j.graylog2.plugin.alarm.execscript/files/target/execscript-1.0.0-SNAPSHOT.jar
# execscript output plugin
RUN cd /opt/graylog2/plugin && wget -q --no-check-certificate --no-cookies https://drone.io/github.com/dfch/biz.dfch.j.graylog2.plugin.output.execscript/files/target/execscript-1.0.0-SNAPSHOT.jar
# auditlog filter plugin
RUN cd /opt/graylog2/plugin && wget -q --no-check-certificate --no-cookies https://drone.io/github.com/dfch/biz.dfch.j.graylog2.plugin.filter.auditlog/files/target/auditlog-1.0.0-SNAPSHOT.jar
# essentially copy the rest from the original Graylog2 Dockerfile
# https://github.com/Graylog2/graylog2-images/blob/master/docker/Dockerfile
VOLUME /var/opt/graylog2/data
VOLUME /var/log/graylog2
# web interface
EXPOSE 9000
# gelf tcp
EXPOSE 12201
# gelf udp
EXPOSE 12201/udp
# gelf http
EXPOSE 12202
# 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