Switched from google-fluentd to configuring fluentd from scratch

This commit is contained in:
Mik Vyatskov 2016-11-02 12:08:36 +01:00
parent 24361fce06
commit b4c7dfa674

View File

@ -21,36 +21,38 @@
# in the Google Developer Console. # in the Google Developer Console.
FROM gcr.io/google_containers/ubuntu-slim:0.4 FROM gcr.io/google_containers/ubuntu-slim:0.4
MAINTAINER Alex Robinson "arob@google.com"
# Disable prompts from apt. MAINTAINER Mik Vyatskov "vmik@google.com"
# Disable prompts from apt
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
# Keeps unneeded configs from being installed along with fluentd.
ENV DO_NOT_INSTALL_CATCH_ALL_CONFIG true
RUN apt-get -q update && \ # Install build tools
apt-get install -y curl ca-certificates gcc make bash && \ RUN apt-get -qq update && \
apt-get install -y --reinstall lsb-base lsb-release && \ apt-get install -y -qq curl ca-certificates gcc make bash sudo && \
echo "Installing logging agent" && \ apt-get install -y -qq --reinstall lsb-base lsb-release
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 && \ # Install logging agent and required gems
/usr/sbin/google-fluentd-gem install fluent-plugin-systemd -v 0.0.3 && \ RUN /usr/bin/curl -sSL https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent2.sh | sh && \
apt-get remove -y gcc make && \ sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent && \
apt-get autoremove -y && \ td-agent-gem install --no-document fluent-plugin-record-reformer -v 0.8.2 && \
apt-get clean && \ td-agent-gem install --no-document fluent-plugin-systemd -v 0.0.5 && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ td-agent-gem install --no-document fluent-plugin-google-cloud -v 0.5.2
/opt/google-fluentd/embedded/share/doc \
/opt/google-fluentd/embedded/share/gtk-doc \ # Remove build tools
/opt/google-fluentd/embedded/lib/postgresql \ RUN apt-get remove -y -qq gcc make && \
/opt/google-fluentd/embedded/bin/postgres \ apt-get autoremove -y -qq && \
/opt/google-fluentd/embedded/share/postgresql \ apt-get clean -qq
/var/log/google-fluentd
# Remove unnecessary files
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Copy the Fluentd configuration files for logging Docker container logs. # Copy the Fluentd configuration files for logging Docker container logs.
# Either configuration file can be used by specifying `-c <file>` as a command # Either configuration file can be used by specifying `-c <file>` as a command
# line argument. # line argument.
COPY google-fluentd.conf /etc/google-fluentd/google-fluentd.conf RUN rm /etc/td-agent/td-agent.conf
COPY google-fluentd-journal.conf /etc/google-fluentd/google-fluentd-journal.conf COPY google-fluentd.conf /etc/td-agent/google-fluentd.conf
COPY google-fluentd-journal.conf /etc/td-agent/google-fluentd-journal.conf
# Start Fluentd to pick up our config that watches Docker container logs. # Start Fluentd to pick up our config that watches Docker container logs.
CMD /usr/sbin/google-fluentd "$FLUENTD_ARGS" CMD /usr/sbin/td-agent "$FLUENTD_ARGS"