Skip to content

Commit

Permalink
working dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
aboguszewski-sumo committed Feb 8, 2024
1 parent ddbb210 commit 6f37743
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Dockerfile_ubi
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ ARG BUILD_TAG
ARG REPO_URL=sumologic-otel-collector
ARG BUILD_ARCH

## Use original image to copy files from
FROM alpine:3.19.1 as certs
RUN apk --update add ca-certificates

FROM ${REPO_URL}:${BUILD_TAG}-${BUILD_ARCH} as builder
FROM alpine:3.19.1 as directories
RUN mkdir /etc/otel/

## Build RedHat compliant image
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9
Expand All @@ -24,14 +26,16 @@ LABEL name="sumologic-otel-collector" \
ADD https://raw.githubusercontent.com/SumoLogic/sumologic-otel-collector/main/LICENSE \
/licenses/LICENSE

RUN microdnf update && microdnf install systemd

ENV TAG $BUILD_TAG
ARG USER_UID=10001
USER ${USER_UID}
ENV HOME /etc/otel/

# copy journalctl and it's dependencies as base structure
COPY --from=builder / /
COPY --from=builder --chown=${USER_UID}:${USER_UID} /etc/otel/ /etc/otel/
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /otelcol-sumo /otelcol-sumo
COPY otelcol-sumo /
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=directories --chown=${USER_UID}:${USER_UID} /etc/otel/ /etc/otel/

ENTRYPOINT ["/otelcol-sumo"]
CMD ["--config", "/etc/otel/config.yaml"]

0 comments on commit 6f37743

Please sign in to comment.