forked from SumoLogic/sumologic-otel-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_dev_fips
43 lines (35 loc) · 1.53 KB
/
Dockerfile_dev_fips
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
FROM alpine:3.16.2 as otelcol
COPY otelcol-sumo /
# This shouldn't be necessary but sometimes we end up with execution bit not set.
# ref: https://github.com/open-telemetry/opentelemetry-collector/issues/1317
RUN chmod 755 /otelcol-sumo
FROM alpine:3.16.2 as certs
RUN apk --update add ca-certificates
FROM alpine:3.16.2 as directories
RUN mkdir /etc/otel/
FROM debian:11.4 as systemd
RUN apt update && apt install -y systemd
# prepare package with journald and it's dependencies keeping original paths
# h stands for dereference of symbolic links
RUN tar czhf journalctl.tar.gz /bin/journalctl $(ldd /bin/journalctl | grep -oP "\/.*? ")
FROM alpine:3.16.2
RUN apk update && apk add curl tar
RUN curl -LJ "https://go-boringcrypto.storage.googleapis.com/go1.18.2b7.linux-amd64.tar.gz" -o go.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go.linux-amd64.tar.gz \
&& rm go.linux-amd64.tar.gz \
&& ln -s /usr/local/go/bin/go /usr/local/bin
ARG BUILD_TAG=latest
ENV TAG $BUILD_TAG
ARG USER_UID=10001
USER ${USER_UID}
ENV HOME /etc/otel/
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=otelcol /otelcol-sumo /otelcol-sumo
COPY --from=directories --chown=${USER_UID}:${USER_UID} /etc/otel/ /etc/otel/
# copy and extract journald with dependencies
COPY --from=systemd --chown=${USER_UID}:${USER_UID} /journalctl.tar.gz /journalctl.tar.gz
USER root
RUN tar xf /journalctl.tar.gz --directory / && rm /journalctl.tar.gz
USER ${USER_UID}
ENTRYPOINT ["/otelcol-sumo"]
CMD ["--config", "/etc/otel/config.yaml"]