forked from fluent/fluentd-kubernetes-daemonset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.erb
51 lines (43 loc) · 1.6 KB
/
Dockerfile.erb
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
48
49
50
51
<% fluentd_ver = version.split("-").first %>
<% target = (dockerfile.split("/").last.split("-").first) %>
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /templates/Dockerfile.erb
FROM fluent/fluentd:<%= fluentd_ver %>
MAINTAINER Eduardo Silva <[email protected]>
USER root
WORKDIR /home/fluent
ENV PATH /home/fluent/.gem/ruby/2.3.0/bin:$PATH
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
build-base \
ruby-dev \
&& echo 'gem: --no-document' >> /etc/gemrc \
&& gem install fluent-plugin-secure-forward \
&& gem install fluent-plugin-record-reformer \
<% case target
when "elasticsearch"%>
&& gem install fluent-plugin-elasticsearch \
<% when "logentries"%>
# && gem install fluent-plugin-logentries \
<% when "loggly"%>
&& gem install fluent-plugin-loggly \
<% when "cloudwatch"%>
&& gem install fluent-plugin-cloudwatch-logs -v 0.3.3 \
<% end%>
&& gem install fluent-plugin-kubernetes_metadata_filter \
&& apk del .build-deps \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem
# Copy configuration files
COPY ./conf/fluent.conf /fluentd/etc/
COPY ./conf/kubernetes.conf /fluentd/etc/
# Copy plugins
COPY plugins /fluentd/plugins/
# Environment variables
ENV FLUENTD_OPT=""
ENV FLUENTD_CONF="fluent.conf"
# jemalloc is memory optimization only available for td-agent
# td-agent is provided and QA'ed by treasuredata as rpm/deb/.. package
# -> td-agent (stable) vs fluentd (edge)
#ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2"
# Run Fluentd
CMD exec fluentd -c /fluentd/etc/$FLUENTD_CONF -p /fluentd/plugins $FLUENTD_OPT