-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
76 lines (62 loc) · 1.71 KB
/
Copy pathDockerfile
File metadata and controls
76 lines (62 loc) · 1.71 KB
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
66
67
68
69
70
71
72
73
74
75
76
FROM docker.io/library/ruby:3.4.10-slim@sha256:d8fd978ffc10f0eddee04aa03eb82e5d247079471392ae655de5ae04bdaad914 AS base
WORKDIR /fluentd
RUN <<EOF
set -eux
apt-get update -qq
apt-get install -y --no-install-recommends \
ca-certificates \
tini \
libjemalloc2 \
libxml2 \
libxslt1.1 \
libcurl4
ln -s "/usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2" /usr/local/lib/libjemalloc.so
rm -rf /var/lib/apt/lists /var/cache/apt/archives
bundle config --global set simulate_version 4
EOF
COPY Gemfile Gemfile.lock ./
ENV BUNDLE_DEPLOYMENT="1" \
BUNDLE_PATH="/usr/local/bundle" \
BUNDLE_BIN="/usr/local/bundle/bin" \
LD_PRELOAD="/usr/local/lib/libjemalloc.so"
FROM base AS build
RUN <<EOF
set -eux
apt-get update -qq
apt-get install -y --no-install-recommends \
make \
gcc \
g++ \
libc-dev \
wget \
bzip2 \
gnupg \
dirmngr \
libssl-dev \
libxml2-dev \
libxslt1-dev
rm -rf /var/lib/apt/lists /var/cache/apt/archives
EOF
RUN <<EOF
set -eux
bundle install --no-cache --jobs=4
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git
EOF
FROM base
RUN <<EOF
set -eux
groupadd --system --gid 2000 fluent
useradd --system --gid fluent --uid 2000 fluent
mkdir -p /fluentd/etc /fluentd/bin /fluentd/data /fluentd/plugins /fluentd/log /fluentd/state
chown -R fluent:fluent /fluentd
EOF
USER fluent:fluent
COPY --chown=fluent:fluent --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
COPY --chown=fluent:fluent fluent.yaml /fluentd/etc/
COPY --chown=fluent:fluent --chmod=755 entrypoint.sh /fluentd/bin/
ENV FLUENTD_DISABLE_BUNDLER_INJECTION="1" \
FLUENTD_CONF="fluent.yaml" \
TMPDIR="/tmp/fluentd"
EXPOSE 24224
ENTRYPOINT ["tini", "--", "/fluentd/bin/entrypoint.sh"]
CMD ["fluentd"]