-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
27 lines (22 loc) · 987 Bytes
/
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
FROM registry.access.redhat.com/ubi9/ubi-minimal as builder
RUN microdnf -y install which golang make
WORKDIR /opt/app-root/src
COPY . .
USER root
RUN make build
#COPY otelcol /otelcol
## Note that this shouldn't be necessary, but in some cases the file seems to be
## copied with the execute bit lost (see #1317)
RUN chmod 755 /opt/app-root/src/_build/otelcol
FROM registry.access.redhat.com/ubi9/ubi-minimal
# Install the systemd package which provides journalctl required by journald receiver and add user to systemd-journal group.
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/journaldreceiver
RUN microdnf -y install systemd
ARG USER_UID=10001
RUN useradd -u ${USER_UID} otelcol && usermod -a -G systemd-journal otelcol
USER ${USER_UID}
COPY --from=builder /opt/app-root/src/_build/otelcol /
COPY configs/otelcol.yaml /etc/otelcol/config.yaml
ENTRYPOINT ["/otelcol"]
CMD ["--config", "/etc/otelcol/config.yaml"]
EXPOSE 4317 55678 55679