-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (46 loc) · 1.92 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
66
67
68
69
70
# syntax=docker/dockerfile:1
FROM rockylinux:8.7 as builder
ARG MAJOR_VERSION=4
ARG MINOR_VERSION=4
ARG PATCH_VERSION=2
USER root
COPY --from=rockylinux:8.7-minimal / /minimal/
RUN dnf update -y --nodocs --releasever 8 --installroot /minimal/ && \
dnf upgrade -y --nodocs --releasever 8 --installroot /minimal/
# TODO - v3 does not have an arm repo, breaks multi-arch build
COPY ./td.repo /minimal/etc/yum.repos.d/td.repo
RUN rpm --import https://packages.treasuredata.com/GPG-KEY-td-agent && \
dnf install td-agent-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-*.el8 libxcrypt -y \
--nodocs --releasever 8 --installroot /minimal/ && \
dnf clean all --installroot /minimal/ && \
adduser -M -u 77 td-agent
USER td-agent
FROM rockylinux:8.7-minimal as rockylinux
USER root
COPY --from=builder /minimal/ /
# Copy Linux user/group files
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
# Copy td-agent.conf
COPY ./td-agent.conf /etc/td-agent/td-agent.conf
HEALTHCHECK --interval=10s --timeout=1m CMD curl -I http://localhost:24220/api/plugins.json
USER td-agent
ENV DEFAULT_CONF="/etc/td-agent/td-agent.conf"
CMD td-agent --config "${DEFAULT_CONF}"
FROM redhat/ubi8-micro as ubi8
USER root
COPY --from=builder /minimal/bin/ /bin/
COPY --from=builder /minimal/lib64/ /lib64/
COPY --from=builder /minimal/usr/ /usr/
COPY --from=builder /minimal/var/log/td-agent/ /var/log/td-agent/
COPY --from=builder /minimal/etc/td-agent/ /etc/td-agent/
COPY --from=builder /minimal/opt/td-agent/ /opt/td-agent/
# Copy Linux user/group files
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
# Copy td-agent.conf
COPY ./td-agent.conf /etc/td-agent/td-agent.conf
HEALTHCHECK --interval=10s --timeout=1m CMD curl -I http://localhost:24220/api/plugins.json
USER td-agent
ENV DEFAULT_CONF="/etc/td-agent/td-agent.conf"
CMD td-agent --config "${DEFAULT_CONF}"