-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (25 loc) · 1.12 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM golang:latest
ARG mage=1.9.0
# Install mage. Required for beats build processes.
RUN wget -qO- https://github.com/magefile/mage/releases/download/v${mage}/mage_${mage}_Linux-64bit.tar.gz | tar -C /bin -zxO mage > /bin/mage
RUN chmod 755 /bin/mage
# Install virtualenv. Required for beats build processes.
RUN apt-get update
# python 3's pip
RUN apt-get install -y python3-pip
RUN pip3 install virtualenv
#RUN go get github.com/elastic/beats
RUN mkdir -p $GOPATH/src/github.com/elastic
RUN git -C $GOPATH/src/github.com/elastic clone https://github.com/elastic/beats.git
WORKDIR $GOPATH/src/github.com/elastic/beats
# Target winlogbeat
WORKDIR $GOPATH/src/github.com/elastic/beats/winlogbeat
# Patch out the `init` function in winlogbeat to avoid this error on non-Windows systems:
# Exiting: Failed to create new event log. No event log API is available on this system
#
# This allows us to run `winlogbeat setup` on linux systems.
RUN sed -i -e 's/^\(func .* \)\(init(.*) error {.*\)$/\1\2 return nil }\n\1_\2/' beater/winlogbeat.go
# Compile winlogbeat
RUN make
# Generate winlogbeat's dashboards/templates/fields/etc
RUN make update