Skip to content

Commit f0f2d49

Browse files
authored
Merge pull request #110 from ChurchDesk/update_packet_beat
Update packet beat
2 parents 83fa1b8 + 5efce0e commit f0f2d49

3 files changed

Lines changed: 17 additions & 38 deletions

File tree

Dockerfile.packetbeat

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM dockerflow/docker-flow-proxy
22

3+
ENV PACKETBEAT_CONFIG /packetbeat/packetbeat.yml
4+
35
RUN apk add --update \
46
openssl \
57
bash \
@@ -12,11 +14,10 @@ RUN apk add glibc-2.25-r0.apk
1214
ENV LANG=C.UTF-8
1315

1416

15-
RUN wget https://artifacts.elastic.co/downloads/beats/packetbeat/packetbeat-5.4.0-linux-x86_64.tar.gz
16-
RUN tar xzf packetbeat-5.4.0-linux-x86_64.tar.gz
17-
RUN rm packetbeat-5.4.0-linux-x86_64.tar.gz
18-
RUN mv packetbeat-5.4.0-linux-x86_64 /packetbeat
19-
COPY packetbeat.yml /packetbeat/packetbeat.yml
17+
RUN wget https://artifacts.elastic.co/downloads/beats/packetbeat/packetbeat-7.16.1-linux-x86_64.tar.gz
18+
RUN tar xzf packetbeat-7.16.1-linux-x86_64.tar.gz
19+
RUN rm packetbeat-7.16.1-linux-x86_64.tar.gz
20+
RUN mv packetbeat-7.16.1-linux-x86_64 /packetbeat
2021
COPY scripts/runner_pbeat.sh /runner_pbeat.sh
2122
RUN chmod +x /runner_pbeat.sh
2223

packetbeat.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

scripts/runner_pbeat.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Start the first process
44
echo 'Packetbeat starting';
5-
nohup ./packetbeat/packetbeat -c /packetbeat/packetbeat.yml &
5+
nohup ./packetbeat/packetbeat -c ${PACKETBEAT_CONFIG} &
66
status=$?
77
if [ $status -ne 0 ]; then
88
echo "Failed to start packetbeat: $status"
@@ -17,6 +17,9 @@ if [ $status -ne 0 ]; then
1717
exit $status
1818
fi
1919

20+
# Give the process a chance to start.
21+
sleep 3
22+
2023
# Naive check runs checks once a minute to see if either of the processes exited.
2124
# This illustrates part of the heavy lifting you need to do if you want to run
2225
# more than one service in a container. The container will exit with an error
@@ -29,9 +32,13 @@ while /bin/true; do
2932
PROCESS_2_STATUS=$?
3033
# If the greps above find anything, they will exit with 0 status
3134
# If they are not both 0, then something is wrong
32-
if [ $PROCESS_1_STATUS -ne 0 -o $PROCESS_2_STATUS -ne 0 ]; then
33-
echo "One of the processes has already exited."
34-
exit -1
35+
if [ $PROCESS_1_STATUS -ne 0 ]; then
36+
echo "Packetbeat has already exited."
37+
exit 1
38+
fi
39+
if [ $PROCESS_2_STATUS -ne 0 ]; then
40+
echo "Docker-flow-proxy has already exited."
41+
exit 1
3542
fi
3643
sleep 60
3744
done

0 commit comments

Comments
 (0)