Sign inSign up

fluent/fluentd

Sponsored OSS

By Fluent organization: Fluentd project

•Updated 5 days ago

Fluentd Docker image by fluent project: http://www.fluentd.org/

Image
377

100M+

Dockerfile
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /Dockerfile.template.erb

# To set multiarch build for Docker hub automated build.
FROM golang:alpine AS builder
WORKDIR /go
ENV QEMU_DOWNLOAD_SHA256 47ae430b0e7c25e1bde290ac447a720e2ea6c6e78cd84e44847edda289e020a8
RUN apk add curl --no-cache
RUN curl -sL -o qemu-3.0.0+resin-arm.tar.gz https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz && echo "$QEMU_DOWNLOAD_SHA256 *qemu-3.0.0+resin-arm.tar.gz" | sha256sum -c - | tar zxvf qemu-3.0.0+resin-arm.tar.gz -C . && mv qemu-3.0.0+resin-arm/qemu-arm-static .

FROM --platform=linux/arm/v7 arm32v7/ruby:3.2-slim-bookworm
COPY --from=builder /go/qemu-arm-static /usr/bin/
LABEL maintainer "Fluentd developers <[email protected]>"
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.17.1"
ARG CROSS_BUILD_START="cross-build-start"
ARG CROSS_BUILD_END="cross-build-end"
RUN [ ${CROSS_BUILD_START} ]

# Do not split this into multiple RUN!
# Docker creates a layer for every RUN-Statement
# therefore an 'apt-get purge' has no effect
RUN apt-get update \
 && apt-get install -y --no-install-recommends \
            ca-certificates tini \
 && buildDeps=" \
      make gcc g++ libc-dev \
      wget bzip2 gnupg dirmngr \
    " \
 && apt-get install -y --no-install-recommends $buildDeps \
 && echo 'gem: --no-document' >> /etc/gemrc \
 && gem install oj -v 3.16.5 \
 && gem install json -v 2.7.4 \
 && gem install rexml -v 3.3.9 \
 && gem install async -v 1.32.1 \
 && gem install async-http -v 0.64.2 \
 && gem install fluentd -v 1.17.1 \
 && export GEM_DIR=$(ruby -e 'puts Gem.dir') \
 && echo GEM_DIR=$GEM_DIR \
 && rm -rf $GEM_DIR/cache/*.gem \
 && find $GEM_DIR -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf \
 && find $GEM_DIR -name "*.so" | xargs -r strip \
 && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
 && wget -O /tmp/jemalloc-5.3.0.tar.bz2 https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 \
 && cd /tmp && tar -xjf jemalloc-5.3.0.tar.bz2 --no-same-owner && cd jemalloc-5.3.0/ \
 # Don't use MADV_FREE to reduce memory usage and improve stability
 # https://github.com/fluent/fluentd-docker-image/pull/350
 && (echo "je_cv_madv_free=no" > config.cache) && ./configure -C && make \
 && mv lib/libjemalloc.so.2 /usr/lib \
 && apt-get purge -y --auto-remove \
                  -o APT::AutoRemove::RecommendsImportant=false \
                  $buildDeps \
                  '*-dev' \
 && rm -rf /var/lib/apt/lists/* \
 && rm -rf /tmp/* /var/tmp/*

RUN groupadd -r fluent && useradd -r -g fluent fluent \
    # for log storage (maybe shared with host)
    && mkdir -p /fluentd/log \
    # configuration/plugins path (default: copied from .)
    && mkdir -p /fluentd/etc /fluentd/plugins \
    && chown -R fluent /fluentd && chgrp -R fluent /fluentd


COPY fluent.conf /fluentd/etc/
COPY entrypoint.sh /bin/


ENV FLUENTD_CONF="fluent.conf"

ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2"
EXPOSE 24224 5140

USER fluent
ENTRYPOINT ["tini",  "--", "/bin/entrypoint.sh"]
CMD ["fluentd"]

RUN [ ${CROSS_BUILD_END} ]