This commit is contained in:
Colin 2024-03-18 22:38:11 -04:00
parent 426a794445
commit b353a6b576
1 changed files with 10 additions and 17 deletions

View File

@ -1,26 +1,19 @@
# Use the official Fluentd Alpine-based image as a base
# Start from the Fluentd official image based on Debian
FROM fluent/fluentd:v1.12-debian-1
# Use root to perform the operations
# Use root for the installation of additional plugins
USER root
# Update and Install build dependencies for native extensions
# This step is necessary for some Fluentd plugins that require native extensions
RUN apk add --no-cache --update build-base ruby-dev
# Install necessary plugins
RUN fluent-gem install fluent-plugin-out-http --no-document && \
fluent-gem install fluent-plugin-record-reformer --no-document && \
fluent-gem install fluent-plugin-rewrite-tag-filter --no-document
# Install any additional dependencies or plugins you need
# Example: fluent-plugin-out-http, adjust according to your needs
RUN fluent-gem install fluent-plugin-out-http --no-document
# Clean up
RUN apk del build-base ruby-dev && \
rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem
# Copy your custom Fluentd configuration file into the image
# Copy your custom Fluentd configuration file
COPY fluent.conf /fluentd/etc/
# Set the configuration file as the main configuration file for Fluentd
ENV FLUENTD_CONF=fluent.conf
# Change the directory permissions as needed
RUN chown -R fluent:fluent /fluentd && chmod -R 700 /fluentd/etc
# Switch back to the fluent user for security
# Switch back to the fluent user
USER fluent