docker-filebeat/Dockerfile

27 lines
758 B
Docker
Raw Normal View History

FROM golang:1.18.1-bullseye as builder
ARG ELASTICSTACK_VERSION=8.1.2
WORKDIR /build
RUN apt update && apt upgrade -y
RUN git clone --single-branch --branch="v${ELASTICSTACK_VERSION}" --depth=1 https://github.com/elastic/beats.git
ENV GOMAXPROCS="4"
RUN cd beats/filebeat/ && \
make
FROM debian:bullseye-slim
COPY --chown=root:filebeat filebeat.yml /usr/share/filebeat/filebeat.yml
COPY --chmod=750 --from=builder /build/beats/filebeat/filebeat /usr/local/bin/filebeat
COPY --chmod=750 entrypoint.sh /entrypoint.sh
ENV ELASTICSEARCH_HOSTS=""
ENV ELASTICSEARCH_USERNAME=""
ENV ELASTICSEARCH_PASSWORD_FILE=""
ENV KIBANA_HOSTS=""
ENTRYPOINT ["/entrypoint.sh"]
CMD ["filebeat", "-e", "--strict.perms=false", "-c", "/usr/share/filebeat/filebeat.yml"]