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 FROM fluent/fluentd:v1.12-debian-1
# Use root to perform the operations # Use root for the installation of additional plugins
USER root USER root
# Update and Install build dependencies for native extensions # Install necessary plugins
# This step is necessary for some Fluentd plugins that require native extensions RUN fluent-gem install fluent-plugin-out-http --no-document && \
RUN apk add --no-cache --update build-base ruby-dev 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 # Copy your custom Fluentd configuration file
# 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 fluent.conf /fluentd/etc/ COPY fluent.conf /fluentd/etc/
# Set the configuration file as the main configuration file for Fluentd # Change the directory permissions as needed
ENV FLUENTD_CONF=fluent.conf 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 USER fluent