-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
21 lines (15 loc) · 1013 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ARG filebeatVersion=6.5.4
ARG goVersion=1.10.6
FROM golang:$goVersion
ARG filebeatVersion
RUN curl -L --output /tmp/filebeat.tar.gz https://github.com/elastic/beats/archive/v$filebeatVersion.tar.gz
RUN mkdir -p /go/src/github.com/elastic/beats && tar -xvzf /tmp/filebeat.tar.gz --strip-components=1 -C /go/src/github.com/elastic/beats
RUN go get -v golang.org/x/vgo
COPY . /go/src/github.com/ozonru/filebeat-throttle-plugin
COPY register/plugin/plugin.go /go/src/github.com/elastic/beats/libbeat/processors/throttle/plugin.go
RUN (cd /go/src/github.com/ozonru/filebeat-throttle-plugin && vgo mod vendor -v)
RUN rm -rf /go/src/github.com/ozonru/filebeat-throttle-plugin/vendor/github.com/elastic
RUN go build -v -o /output/filebeat_throttle_linux.so -buildmode=plugin github.com/elastic/beats/libbeat/processors/throttle
FROM docker.elastic.co/beats/filebeat:$filebeatVersion
COPY --from=0 /output/filebeat_throttle_linux.so /filebeat_throttle_linux.so
CMD ["-e", "--plugin", "/filebeat_throttle_linux.so"]