@@ -2,16 +2,48 @@ ARG VERSION=8.2.0
2
2
ARG TOOL=splunk
3
3
FROM splunk/${TOOL}:${VERSION}
4
4
5
+
5
6
USER root
6
7
8
+ # Do this 1st - it takes the longest
9
+ RUN sed -i 's/41812/1000/g' /etc/passwd && \
10
+ sed -i 's/41812/1000/g' /etc/group && \
11
+ chown -R 1000:1000 /home/splunk /opt/splunk*
12
+
7
13
RUN update-ca-trust && \
8
14
microdnf install -y vim git-core jq nmap net-tools lsof && \
9
15
microdnf clean all
10
16
11
- RUN sed -i 's/41812/1000/g' /etc/passwd && \
12
- sed -i 's/41812/1000/g' /etc/group && \
13
- chown -R 1000:1000 /home/splunk /opt/splunk*
17
+ RUN curl -s -L -f -o /tmp/tcpdump.rpm http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/tcpdump-4.9.3-1.el8.x86_64.rpm && \
18
+ rpm -i /tmp/tcpdump.rpm && \
19
+ rm /tmp/tcpdump.rpm
14
20
15
21
ADD ./refresh /usr/bin/refresh
22
+ ADD ./web.conf /tmp/web.conf
23
+ RUN chown -R 1000:1000 /tmp/web.conf
24
+
25
+
26
+ USER splunk
27
+
28
+ # add splunk to the path
29
+ RUN if [[ -e /opt/splunk-etc ]];then \
30
+ echo -e '\n export PATH=$PATH:/opt/splunk/bin' >> $HOME/.bashrc ; fi
31
+
32
+ RUN if [[ -e /opt/splunkforwarder-etc ]];then \
33
+ echo -e '\n export PATH=$PATH:/opt/splunkforwarder/bin' >> $HOME/.bashrc ; fi
34
+
35
+ # disable caching of web assets on splunk servers
36
+ RUN if [[ -e /opt/splunk-etc ]];then \
37
+ mkdir -p /opt/splunk-etc/system/local && \
38
+ cp /tmp/web.conf /opt/splunk-etc/system/local/web.conf ; fi
39
+ RUN rm -f /tmp/web.conf
40
+
41
+ # install suit toolkit if splunk server
42
+ RUN if [[ -e /opt/splunk-etc ]];then \
43
+ (curl -s -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash) && \
44
+ source ~/.bashrc && \
45
+ nvm install lts/fermium && \
46
+ npm install -g @splunk/create && \
47
+ npm install -g yarn ; fi
16
48
17
49
USER ansible
0 commit comments