Skip to content

Instantly share code, notes, and snippets.

@smdmts
Created June 27, 2016 14:15
Show Gist options
  • Save smdmts/10ec5f5b8bfbfbc2db0b268ff0c56ea3 to your computer and use it in GitHub Desktop.
Save smdmts/10ec5f5b8bfbfbc2db0b268ff0c56ea3 to your computer and use it in GitHub Desktop.
Fluentd V14 with fluent-plugin-parser OK Pattern
FROM cybercode/alpine-ruby:2.3
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.1"
# Do not split this into multiple RUN!
# Docker creates a layer for every RUN-Statement
# therefore an 'apk delete build*' has no effect
RUN apk --no-cache --update add \
build-base ruby-dev libc-dev linux-headers libxml2-dev \
openssl-dev libxslt-dev \
ca-certificates \
ruby \
ruby-irb \
ruby-dev \
make \
g++ \
bash gawk sed grep bc coreutils && \
echo 'gem: --no-document' >> /etc/gemrc && \
gem install oj && \
gem install fluentd -v 0.14.0 && \
apk del build-base ruby-dev && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
# for log storage (maybe shared with host)
RUN mkdir -p /fluentd/conf && \
mkdir -p /fluentd/etc && \
mkdir -p /fluentd/buffer && \
mkdir -p /fluentd/dest && \
mkdir -p /fluentd/plugins
# Tell ruby to install packages as user
RUN echo "gem: --user-install --no-document" >> ~/.gemrc
ENV PATH /root/.gem/ruby/2.3.0/bin:$PATH
ENV GEM_PATH /root/.gem/ruby/2.3.0:$GEM_PATH
ENV LANG ja_JP.UTF-8
ENV FLUENTD_OPT=""
ENV FLUENTD_CONF="/fluentd/conf/fluent-worker.conf"
ENV RUBY_GC_MALLOC_LIMIT=2000000
ENV RUBY_GC_MALLOC_LIMIT_MAX=4000000
RUN gem install fluent-plugin-parser
COPY conf/* /fluentd/conf/
ONBUILD COPY conf/* /fluentd/conf/
ONBUILD COPY plugins/* /fluentd/plugins/
EXPOSE 24224
CMD exec fluentd -c $FLUENTD_CONF -p /fluentd/plugins $FLUENTD_OPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment