-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.filebeat
43 lines (35 loc) · 1.61 KB
/
Dockerfile.filebeat
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
40
41
42
43
FROM golang:1.15-alpine as builder
ENV PILOT_DIR /go/src/github.com/AliyunContainerService/log-pilot
ARG GOOS=linux
ARG GOARCH=amd64
RUN set -ex && apk add --no-cache make git gcc libc-dev
WORKDIR $PILOT_DIR
COPY . $PILOT_DIR
RUN go install
FROM alpine:3.6
ENV FILEBEAT_VERSION=6.1.1-3
COPY assets/glibc/glibc-2.26-r0.apk /tmp/
COPY filebeat-6.1.1-3-linux-x86_64.tar.gz /tmp
RUN apk update && \
apk add python && \
apk add ca-certificates && \
apk add wget && \
update-ca-certificates && \
mkdir -p /etc/filebeat /var/lib/filebeat /var/log/filebeat && \
tar zxf /tmp/filebeat-${FILEBEAT_VERSION}-linux-x86_64.tar.gz -C /tmp/ && \
cp -rf /tmp/filebeat-${FILEBEAT_VERSION}-linux-x86_64/filebeat /usr/bin/ && \
cp -rf /tmp/filebeat-${FILEBEAT_VERSION}-linux-x86_64/fields.yml /etc/filebeat/ && \
cp -rf /tmp/filebeat-${FILEBEAT_VERSION}-linux-x86_64/kibana /etc/filebeat/ && \
cp -rf /tmp/filebeat-${FILEBEAT_VERSION}-linux-x86_64/module /etc/filebeat/ && \
cp -rf /tmp/filebeat-${FILEBEAT_VERSION}-linux-x86_64/modules.d /etc/filebeat/ && \
apk add --allow-untrusted /tmp/glibc-2.26-r0.apk && \
rm -rf /var/cache/apk/* /tmp/filebeat-${FILEBEAT_VERSION}-linux-x86_64.tar.gz /tmp/filebeat-${FILEBEAT_VERSION}-linux-x86_64 /tmp/glibc-2.26-r0.apk
COPY --from=builder /go/bin/log-pilot /pilot/pilot
COPY assets/entrypoint assets/filebeat/ assets/healthz /pilot/
RUN chmod +x /pilot/pilot /pilot/entrypoint /pilot/healthz /pilot/config.filebeat
HEALTHCHECK CMD /pilot/healthz
VOLUME /var/log/filebeat
VOLUME /var/lib/filebeat
WORKDIR /pilot/
ENV PILOT_TYPE=filebeat
ENTRYPOINT ["/pilot/entrypoint"]