anchor.diff:       && apt-get upgrade -y \
        && apt-get install \
        -y --no-install-recommends \
  +<% if is_v1 %>
  +     $buildDeps libjemalloc1 \
  +<% else %>
        $buildDeps \
  +<% end %>
        ruby-bundler \
   <% end %>
       && bundle config silence_root_warning true \
  
positive.code: <% fluentd_ver = version.split("-").first %>
  <% target = (dockerfile.split("/").last.split("-").last) %>
  <% requires_git = %w(graylog syslog).include? target %>
  <% is_alpine = (dockerfile.split("/").last.split("-").first == "alpine") %>
  
negative.code: ENV FLUENTD_OPT=""
  ENV FLUENTD_CONF="fluent.conf"
  
  <% if is_v1 %>
  # See https://packages.debian.org/stretch/amd64/libjemalloc1/filelist
  ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.1"
  <% else %>
  # 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"
  <% end %>
  
  # Run Fluentd
  CMD ["/fluentd/entrypoint.sh"]
  