forked from dockersecureimages/filebeat-oss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (35 loc) · 1.8 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
33
34
35
36
37
38
39
40
41
42
43
FROM alpine:3.18.3
LABEL maintainer="Roney dsilva"
ARG FILEBEAT_VERSION=7.12.1
ARG TARBALL_ASC="https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-oss-${FILEBEAT_VERSION}-linux-x86_64.tar.gz.asc"
ARG TARBALL_SHA="edb6432a1bf4221f478eb4b6c01d4b116c7b7316b49aaafb438e467244d1c44f135c026b06d8a2a62d9943a43444e78899d5b76152f31443577fb6b486ca8d7b"
ARG GPG_KEY="46095ACC8548582C1A2699A9D27D666CD88E42B4"
ENV PATH $PATH:/usr/share/filebeat
RUN apk add --no-cache bash su-exec libc6-compat curl &&\
apk add --no-cache -t .build-deps ca-certificates gnupg openssl &&\
set -ex &&\
wget -O /tmp/filebeat.tar.gz https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-oss-${FILEBEAT_VERSION}-linux-x86_64.tar.gz &&\
if [ "$TARBALL_SHA" ]; then \
echo "$TARBALL_SHA /tmp/filebeat.tar.gz" | sha512sum -c - ;\
fi &&\
if [ "$TARBALL_ASC" ]; then \
wget -O /tmp/filebeat.tar.gz.asc "$TARBALL_ASC" &&\
export GNUPGHOME="$(mktemp -d)" &&\
( gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
|| gpg --keyserver pgp.mit.edu --recv-keys "$GPG_KEY" \
|| gpg --keyserver keyserver.pgp.com --recv-keys "$GPG_KEY" ) &&\
gpg --batch --verify /tmp/filebeat.tar.gz.asc /tmp/filebeat.tar.gz &&\
rm -rf "$GNUPGHOME" || true ;\
fi &&\
tar -xzf /tmp/filebeat.tar.gz -C /tmp/ &&\
mv /tmp/filebeat-${FILEBEAT_VERSION}-linux-x86_64 /usr/share/filebeat &&\
mkdir -p /usr/share/filebeat/logs /usr/share/filebeat/data &&\
adduser -DH -s /sbin/nologin filebeat &&\
chown -R filebeat:filebeat /usr/share/filebeat &&\
apk del --purge .build-deps &&\
rm -rf /tmp/* /var/cache/apk/*
ADD data/ /
RUN chmod +x /*.sh
WORKDIR /usr/share/filebeat
ENTRYPOINT ["/filebeat-entrypoint.sh"]
CMD [ "-e", "-c", "/usr/share/filebeat/filebeat.yml"]