-
Notifications
You must be signed in to change notification settings - Fork 399
/
Dockerfile.filebeat-arm64
47 lines (39 loc) · 1.98 KB
/
Dockerfile.filebeat-arm64
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
44
45
46
47
FROM golang:1.9-alpine3.6 as builder
ENV PILOT_DIR /go/src/github.com/AliyunContainerService/log-pilot
ARG GOOS=linux
ARG GOARCH=arm64
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
set -ex && apk add --no-cache make git gcc g++
WORKDIR $PILOT_DIR
COPY . $PILOT_DIR
RUN go install
FROM alpine:3.6
# 注意alpine mul libc 与 gnc libc
ENV FILEBEAT_VERSION=6.1.1-3
COPY assets/glibc/arm64/glibc-2.23-r3.apk /tmp/
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk update && \
apk add python && \
apk add ca-certificates && \
apk add wget bash libc6-compat && \
update-ca-certificates && \
wget http://acs-logging.oss-cn-hangzhou.aliyuncs.com/beats/filebeat/filebeat-${FILEBEAT_VERSION}-linux-arm64.tar.gz -P /tmp/ && \
mkdir -p /etc/filebeat /var/lib/filebeat /var/log/filebeat && \
tar zxf /tmp/filebeat-${FILEBEAT_VERSION}-linux-arm64.tar.gz -C /tmp/ && \
cp -rf /tmp/filebeat-${FILEBEAT_VERSION}-linux-arm64/filebeat /usr/bin/ && \
cp -rf /tmp/filebeat-${FILEBEAT_VERSION}-linux-arm64/fields.yml /etc/filebeat/ && \
cp -rf /tmp/filebeat-${FILEBEAT_VERSION}-linux-arm64/kibana /etc/filebeat/ && \
cp -rf /tmp/filebeat-${FILEBEAT_VERSION}-linux-arm64/module /etc/filebeat/ && \
cp -rf /tmp/filebeat-${FILEBEAT_VERSION}-linux-arm64/modules.d /etc/filebeat/ && \
apk add --allow-untrusted /tmp/glibc-2.23-r3.apk && \
ln -s /lib/ld-musl-aarch64.so.1 /lib/ld-linux-aarch64.so.1 && \
rm -rf /var/cache/apk/* /tmp/filebeat-${FILEBEAT_VERSION}-linux-arm64.tar.gz /tmp/filebeat-${FILEBEAT_VERSION}-linux-arm64 /tmp/glibc-2.23-r3.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"]