diff --git a/templates/Dockerfile.erb b/templates/Dockerfile.erb index 2492989ab8..907acc84a0 100644 --- a/templates/Dockerfile.erb +++ b/templates/Dockerfile.erb @@ -17,22 +17,30 @@ ENV GEM_HOME /fluentd/vendor/bundle/ruby/2.6.0 ENV FLUENTD_DISABLE_BUNDLER_INJECTION 1 COPY Gemfile* /fluentd/ - RUN buildDeps="sudo make gcc g++ libc-dev libffi-dev<% if target == "graylog" %> build-essential patch zlib1g-dev liblzma-dev<% elsif target == "kafka" %> build-essential autoconf automake libtool pkg-config<% end %><% if requires_git %> git<% end %>" \ - && apt-get update \ - && apt-get upgrade -y \ - && apt-get install \ - -y --no-install-recommends \ - $buildDeps net-tools \ - && gem install bundler --version 1.16.2 \ - && bundle config silence_root_warning true \ - && bundle install --gemfile=/fluentd/Gemfile --path=/fluentd/vendor/bundle \ - && SUDO_FORCE_REMOVE=yes \ - apt-get purge -y --auto-remove \ - -o APT::AutoRemove::RecommendsImportant=false \ - $buildDeps \ - && rm -rf /var/lib/apt/lists/* \ - && gem sources --clear-all \ - && rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem + +RUN buildDeps="sudo make gcc g++ libc-dev libffi-dev<% if target == "graylog" %> build-essential patch zlib1g-dev liblzma-dev \ +<% elsif target == "kafka" %> build-essential autoconf automake libtool pkg-config python <% end %><% if requires_git %> git<% end %>" \ +runtimeDeps="<% if target == "kafka" %>krb5-kdc libsasl2-modules-gssapi-mit libsasl2-dev <% end %> " \ + && export DEBIAN_FRONTEND=noninteractive \ + && apt-get update \ + && apt-get upgrade -y \ + && apt-get install \ + -y --no-install-recommends \ + $buildDeps $runtimeDeps net-tools \ + && gem install bundler --version 1.16.2 \ + && bundle config silence_root_warning true \ + && bundle install --gemfile=/fluentd/Gemfile --path=/fluentd/vendor/bundle \ + && SUDO_FORCE_REMOVE=yes \ + apt-get purge -y --auto-remove \ + -o APT::AutoRemove::RecommendsImportant=false \ + $buildDeps \ + && rm -rf /var/lib/apt/lists/* \ + && gem sources --clear-all \ + && rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem \ + <% if target == "kafka" %> \ + && ldconfig -p | grep -q "libsasl2.so$" \ + && ldconfig -p | grep -q "libsasl2.so.2" \ + <% end %> # Copy configuration files COPY ./conf/fluent.conf /fluentd/etc/ diff --git a/templates/Gemfile.erb b/templates/Gemfile.erb index fae1969909..f92ff59138 100644 --- a/templates/Gemfile.erb +++ b/templates/Gemfile.erb @@ -91,7 +91,8 @@ gem "fluent-plugin-remote_syslog" gem "fluent-plugin-kubernetes_remote_syslog" <% end %> <% when "kafka" %> -gem "fluent-plugin-kafka", "~> 0.7.9" +gem "rdkafka", "~> 0.7.0" +gem "fluent-plugin-kafka", "~> 0.12.2" gem "snappy", "~> 0.0.15" <% when "kinesis" %> <% if is_v1 %>