-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
39 lines (24 loc) · 933 Bytes
/
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
33
34
35
36
37
38
39
FROM registry.js.design/base/golang:1.18-alpine3.16 AS build
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64 \
GOPROXY=https://goproxy.cn,direct
COPY . /workspace
WORKDIR /workspace
RUN go mod tidy && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o point ./main.go && \
chmod 777 point
FROM elastic/filebeat:7.17.10
USER root
COPY --from=build /workspace/point /usr/share/filebeat/point/point
COPY assets/entrypoint assets/filebeat/ assets/healthz /usr/share/filebeat/point/
RUN apt-get update && \
apt-get -y install python2 && \
/usr/bin/chmod +x /usr/share/filebeat/point/point /usr/share/filebeat/point/healthz /usr/share/filebeat/point/config.filebeat
HEALTHCHECK CMD /usr/share/filebeat/healthz
VOLUME /var/log/filebeat
VOLUME /var/lib/filebeat
WORKDIR /usr/share/filebeat/
ENV PILOT_TYPE=filebeat
ENTRYPOINT ["python2", "/usr/share/filebeat/point/entrypoint"]