kubernetes/contrib/logging/fluentd-sidecar-gcp/Dockerfile
Todd Derr 98ed2e8606 Remove gem update for fluent-plugin-google-cloud
This was originally submitted to pick up v0.3.1 of the cloud logging
plugin which had a fix for the name 'metadata' failing to resolve.
Since new releases of google-fluentd have this fix, it is no longer
required.

I've done some additional testing of 'gem update' behavior in the interim
and I think it is ok to use in targeted situations, but we should not be
doing an unconstrained update in general. The issue is that updating a
gem may bring new dependencies, some of those dependencies may include
native code, so it may try to launch a compiler, which isn't desirable
and prone to failure.

If we do need to grab an updated gem in the future we should specify an
explicit version and the --minimal-deps flag.
2015-07-23 15:06:56 -04:00

35 lines
1.8 KiB
Docker

# This Dockerfile will build an image that is configured to use Fluentd to
# collect container log files from the specified paths and send them to the
# Google Cloud Logging API.
# The environment variable that controls which log files are collected is
# FILES_TO_COLLECT. Files specified in the environment variable should be
# separated by whitespace, as in "/var/log/syslog /var/log/nginx/access.log".
# This configuration assumes that the host performing the collection is a VM
# that has been created with a logging.write scope and that the Logging API
# has been enabled for the project in the Google Developer Console.
FROM ubuntu:14.04
MAINTAINER Alex Robinson "arob@google.com"
# Disable prompts from apt.
ENV DEBIAN_FRONTEND noninteractive
# Install the Fluentd agent that knows how to send logs to Google Cloud Logging.
RUN apt-get -q update && \
apt-get install -y curl && \
apt-get clean && \
curl -s https://storage.googleapis.com/signals-agents/logging/google-fluentd-install.sh | sudo bash
# Copy the configuration file generator for creating input configurations for
# each file specified in the FILES_TO_COLLECT environment variable.
COPY config_generator.sh /usr/local/sbin/config_generator.sh
# Copy the Fluentd configuration file for collecting from all the inputs
# generated by the config generator and sending them to Google Cloud Logging.
COPY google-fluentd.conf /etc/google-fluentd/google-fluentd.conf
# Run the config generator to get the config files in place and start Fluentd.
# We have to run the config generator at runtime rather than now so that it can
# incorporate the files provided in the environment variable in its config.
CMD /usr/local/sbin/config_generator.sh && /usr/sbin/google-fluentd -qq --use-v1-config --suppress-repeated-stacktrace > /var/log/google-fluentd/google-fluentd.log