Commit b4c7dfa6 authored by Mik Vyatskov's avatar Mik Vyatskov

Switched from google-fluentd to configuring fluentd from scratch

parent 24361fce
...@@ -21,36 +21,38 @@ ...@@ -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 # Install build tools
RUN apt-get -qq update && \
RUN apt-get -q update && \ apt-get install -y -qq curl ca-certificates gcc make bash sudo && \
apt-get install -y curl ca-certificates gcc make bash && \ apt-get install -y -qq --reinstall lsb-base lsb-release
apt-get install -y --reinstall lsb-base lsb-release && \
echo "Installing logging agent" && \ # Install logging agent and required gems
curl -sSL https://dl.google.com/cloudagents/install-logging-agent.sh | bash && \ RUN /usr/bin/curl -sSL https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent2.sh | sh && \
/usr/sbin/google-fluentd-gem install fluent-plugin-record-reformer -v 0.8.1 && \ sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent && \
/usr/sbin/google-fluentd-gem install fluent-plugin-systemd -v 0.0.3 && \ td-agent-gem install --no-document fluent-plugin-record-reformer -v 0.8.2 && \
apt-get remove -y gcc make && \ td-agent-gem install --no-document fluent-plugin-systemd -v 0.0.5 && \
apt-get autoremove -y && \ td-agent-gem install --no-document fluent-plugin-google-cloud -v 0.5.2
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ # Remove build tools
/opt/google-fluentd/embedded/share/doc \ RUN apt-get remove -y -qq gcc make && \
/opt/google-fluentd/embedded/share/gtk-doc \ apt-get autoremove -y -qq && \
/opt/google-fluentd/embedded/lib/postgresql \ apt-get clean -qq
/opt/google-fluentd/embedded/bin/postgres \
/opt/google-fluentd/embedded/share/postgresql \ # Remove unnecessary files
/var/log/google-fluentd 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"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment