-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile-ubi
55 lines (45 loc) · 1.65 KB
/
Dockerfile-ubi
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
FROM hashicorp/terraform:1.9.7 as terraform
FROM registry.access.redhat.com/ubi8/ubi:8.10
ENV SUMMARY="UBI based Sumo Logic Kubernetes Setup" \
DESCRIPTION="UBI based setup image for the Sumo Logic Kubernetes Collection"
ENV COLLECTION_VERSION=v4.6.1
ENV MONITORS_VERSION=v1.2.4
ARG TARGETPLATFORM
RUN dnf update -y \
&& dnf install -y \
bash \
curl \
jq \
git \
&& dnf clean all \
&& groupadd -g 1000 setup \
&& adduser -u 1000 -g setup setup \
&& mkdir /terraform /scripts /monitors \
&& chown -R setup:setup /terraform /scripts /monitors
COPY --from=terraform /bin/terraform /usr/local/bin/terraform
USER setup
RUN cd /terraform/ \
&& curl -O https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/${COLLECTION_VERSION}/deploy/helm/sumologic/conf/setup/main.tf \
&& terraform init \
&& rm main.tf
RUN cd /monitors/ \
&& git clone https://github.com/SumoLogic/terraform-sumologic-sumo-logic-monitor.git \
&& cd terraform-sumologic-sumo-logic-monitor \
&& git checkout ${MONITORS_VERSION} \
&& cd .. \
&& cp terraform-sumologic-sumo-logic-monitor/monitor_packages/kubernetes/* . \
&& terraform init -input=false || terraform init -input=false -upgrade \
&& rm -rf terraform-sumologic-sumo-logic-monitor
ARG BUILD_TAG=latest
ENV TAG=$BUILD_TAG
LABEL name="Sumo Logic Kubernetes Setup" \
vendor="Sumo Logic" \
version="${BUILD_TAG}" \
release="1" \
summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
maintainer="[email protected]"
ADD LICENSE \
/licenses/LICENSE
WORKDIR /terraform/