-
Notifications
You must be signed in to change notification settings - Fork 352
/
Copy pathDockerfile
66 lines (56 loc) · 2.5 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /Dockerfile.template.erb
FROM ruby:3.2-slim-bookworm
LABEL maintainer "Fluentd developers <fluentd@googlegroups.com>"
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.18.0"
# 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.18.0 \
&& export GEM_DIR=$(ruby -e 'puts Gem.dir') \
&& echo GEM_DIR=$GEM_DIR \
&& rm -rf $GEM_DIR/cache/*.gem \
# Don't purge $GEM_DIR/gems/GEM/lib/GEM/ext because it might contain runtime .so (e.g json)
&& find $GEM_DIR -maxdepth 3 -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rfv \
&& 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"]