-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
39 lines (32 loc) · 1.28 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
FROM hashicorp/terraform:1.9.7 as terraform
FROM alpine:3.20.3
ENV COLLECTION_VERSION=5577707ce153198a2dacbdfc6baa8db349cac944
ENV MONITORS_VERSION=v1.2.5
ARG TARGETPLATFORM
RUN apk add --no-cache \
bash \
curl \
jq \
git \
&& apk upgrade \
&& addgroup -g 1000 setup \
&& adduser -u 1000 -D -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
WORKDIR /terraform/