Change:
It's 400+mb and we need to pull it on every node. This leads to a lot of image pulling flake (), and also gets very expensive in some countries where bandwidth is sold at a premium. We took a stab at halving the size with: , but then realized that we were using an unsupported base image We tried to optimize to ~300Mb by building a smaller ubuntu:15 base, but that's still huge. Every other mandatory system daemon is built on busybox and so takes ~10Mb.
I can try again now that the agent supports
Newer Docker images using the spec from the official repository are based on AlpineLinux and are around ~38MB:

Discussion:
# Please see http://docs.fluentd.org/articles/install-by-deb for more # information about installing fluentd using deb package. <del> FROM ubuntu:14.04 </del> <ins> FROM gcr.io/google_containers/ubuntu-slim:0.4 </ins> MAINTAINER Alex Robinson "arob@google.com" MAINTAINER Jimmi Dyson "jimmidyson@gmail.com"

# Disable prompts from apt. ENV DEBIAN_FRONTEND noninteractive <del> # Install prerequisites. RUN apt-get update &&  apt-get install -y -q curl make g++ &&  apt-get clean &&  rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Install Fluentd. RUN /usr/bin/curl -L https://td-toolbelt.herokuapp.com/sh/install-ubuntu-trusty-td-agent2.sh | sh # Change the default user and group to root. # Needed to allow access to /var/log/docker/... files. RUN sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent # Install the Elasticsearch Fluentd plug-in. RUN td-agent-gem install fluent-plugin-kubernetes_metadata_filter fluent-plugin-elasticsearch </del> # Copy the Fluentd configuration file. COPY td-agent.conf /etc/td-agent/td-agent.conf <ins> COPY build.sh /tmp/build.sh RUN /tmp/build.sh </ins> # Run the Fluentd service. ENTRYPOINT ["td-agent"]

.PHONY:	build push IMAGE = fluentd-elasticsearch <del> TAG = 1.17 </del> <ins> TAG = 1.19 </ins> build: docker build -t gcr.io/google_containers/$(IMAGE):$(TAG) .

<ins> #!/bin/sh # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #     http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Install prerequisites. apt-get update apt-get install -y -q --no-install-recommends  curl ca-certificates make g++ sudo bash # Install Fluentd. /usr/bin/curl -sSL https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent2.sh | sh # Change the default user and group to root. # Needed to allow access to /var/log/docker/... files. sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent # Install the Elasticsearch Fluentd plug-in. # http://docs.fluentd.org/articles/plugin-management td-agent-gem install --no-document fluent-plugin-kubernetes_metadata_filter -v 0.24.0 td-agent-gem install --no-document fluent-plugin-elasticsearch -v 1.5.0 # Remove docs and postgres references rm -rf /opt/td-agent/embedded/share/doc  /opt/td-agent/embedded/share/gtk-doc  /opt/td-agent/embedded/lib/postgresql  /opt/td-agent/embedded/bin/postgres  /opt/td-agent/embedded/share/postgresql apt-get remove -y make g++ apt-get autoremove -y apt-get clean -y rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* </ins>

tag kube-scheduler </source> <del> <filter kubernetes.**> type kubernetes_metadata </filter> </del> <ins> #<filter kubernetes.**> #  type kubernetes_metadata #</filter> </ins> # Example: # I0603 15:31:05.793605       6 cluster_manager.go:230] Reading config from path /etc/gce.conf

# scope and that the Logging API has been enabled for the project # in the Google Developer Console. <del> FROM ubuntu:16.04 </del> <ins> FROM gcr.io/google_containers/ubuntu-slim:0.4 </ins> MAINTAINER Alex Robinson "arob@google.com" # Disable prompts from apt.

ENV DO_NOT_INSTALL_CATCH_ALL_CONFIG true RUN apt-get -q update &&  <del> apt-get install -y curl &&  apt-get install -y gcc &&  apt-get install -y make &&  </del> <ins> apt-get install -y curl ca-certificates gcc make bash &&  apt-get install -y --reinstall lsb-base lsb-release &&  echo "Installing logging agent" &&  curl -sSL https://dl.google.com/cloudagents/install-logging-agent.sh | bash &&  /usr/sbin/google-fluentd-gem install fluent-plugin-record-reformer -v 0.8.1  &&  /usr/sbin/google-fluentd-gem install fluent-plugin-systemd -v 0.0.3 &&  apt-get remove -y gcc make &&  apt-get autoremove -y &&  </ins> apt-get clean &&  <del> rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&  curl -s https://dl.google.com/cloudagents/install-logging-agent.sh | bash # Install the record reformer and systemd plugins. RUN /usr/sbin/google-fluentd-gem install fluent-plugin-record-reformer -v 0.8.1 RUN /usr/sbin/google-fluentd-gem install fluent-plugin-systemd -v 0.0.3 # Remove the misleading log file that gets generated when the agent is installed RUN rm -rf /var/log/google-fluentd </del> <ins> rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*  /opt/google-fluentd/embedded/share/doc  /opt/google-fluentd/embedded/share/gtk-doc  /opt/google-fluentd/embedded/lib/postgresql  /opt/google-fluentd/embedded/bin/postgres  /opt/google-fluentd/embedded/share/postgresql  /var/log/google-fluentd </ins> # Copy the Fluentd configuration files for logging Docker container logs. # Either configuration file can be used by specifying `-c <file>` as a command

.PHONY:	kbuild kpush <del> TAG = 1.21 </del> <ins> TAG = 1.25 </ins> # Rules for building the test image for deployment to Dockerhub with user kubernetes.