Skip to content

Instantly share code, notes, and snippets.

@nicksan2c
Forked from bdenning/Dockerfile
Created April 16, 2017 20:35
Show Gist options
  • Save nicksan2c/478c3afb04973630c9a69628af2b203a to your computer and use it in GitHub Desktop.
Save nicksan2c/478c3afb04973630c9a69628af2b203a to your computer and use it in GitHub Desktop.
Dockerfile for creating Splunk container
FROM docker.io/centos:latest
MAINTAINER Bowen Denning <[email protected]>
ENV PATH=$PATH:/opt/splunk/bin
RUN yum update -y
## Download and install Splunk
RUN curl https://download.splunk.com/products/splunk/releases/6.4.1/linux/splunk-6.4.1-debde650d26e-linux-2.6-x86_64.rpm -O && \
yum install -y splunk*.rpm && \
rm splunk*.rpm
## Bootstrap Splunk and set it listening for syslog on tcp:9514
RUN splunk version --accept-license && \
splunk add tcp 9514 -index main -sourcetype tcp:9514
## Configure Splunk path
RUN echo -e "export PATH=$PATH:/opt/splunk/bin" >> ~/.bashrc
## Start Splunk
COPY entrypoint.sh /sbin/entrypoint.sh
RUN chmod +x /sbin/entrypoint.sh
EXPOSE 8000/tcp 8089/tcp 9997/tcp 9514/tcp
WORKDIR /opt/splunk
ENTRYPOINT ["/sbin/entrypoint.sh"]
EXPOSE 8000/tcp 8089/tcp 9997/tcp 9514/tcp
WORKDIR /opt/splunk
ENTRYPOINT ["/sbin/entrypoint.sh"]
#!/bin/bash
/opt/splunk/bin/splunk start &&
tail -f /opt/splunk/var/log/splunk/splunkd.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment