fluentd-concenter/Dockerfile

48 lines
1.4 KiB
Docker

#inspired from https://github.com/fluent/fluentd-docker-image/blob/master/v1.16/alpine/Dockerfile
FROM alpine:3.18
LABEL maintainer "Stefan Reimer<stefan@zero-downtime.net>"
LABEL Description="Fluentd docker image intended as ingestion service" Vendor="Zero Down Time" Version="${version}"
COPY Gemfile* /fluentd/
# skip runtime bundler installation
ENV FLUENTD_DISABLE_BUNDLER_INJECTION 1
RUN apk update \
&& apk add --no-cache \
ca-certificates \
ruby ruby-irb ruby-etc ruby-webrick \
tini ruby-bundler \
&& apk add --no-cache --virtual .build-deps \
build-base linux-headers \
ruby-dev gnupg \
&& echo 'gem: --no-document' >> /etc/gemrc \
# Install additional gems from Gemfile
&& bundle config silence_root_warning true \
&& bundle install --gemfile=/fluentd/Gemfile \
&& apk del .build-deps \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/3.*/gems/fluentd-*/test
RUN addgroup -S fluent && adduser -S -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 FLUENTD_OPT=""
ENV LD_PRELOAD=""
EXPOSE 24224 5140
USER fluent
ENTRYPOINT ["tini", "--", "/bin/entrypoint.sh"]
CMD ["fluentd"]