This repository was archived by the owner on Feb 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
38 lines (26 loc) · 1.56 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
FROM --platform=$BUILDPLATFORM alpine:3.18.3 as builder
ARG TARGETOS TARGETARCH
ARG TFLINT_VERSION=0.48.0
ARG AWS_VERSION=0.26.0
ARG AZURERM_VERSION=0.24.0
ARG GOOGLE_VERSION=0.24.0
RUN wget -O /tmp/tflint.zip https://github.com/terraform-linters/tflint/releases/download/v"${TFLINT_VERSION}"/tflint_"${TARGETOS}"_"${TARGETARCH}".zip \
&& unzip /tmp/tflint.zip -d /usr/local/bin \
&& rm /tmp/tflint.zip
RUN mkdir -p ~/.tflint.d/plugins
RUN wget -O /tmp/tflint-ruleset-aws.zip https://github.com/terraform-linters/tflint-ruleset-aws/releases/download/v"${AWS_VERSION}"/tflint-ruleset-aws_"${TARGETOS}"_"${TARGETARCH}".zip \
&& unzip /tmp/tflint-ruleset-aws.zip -d ~/.tflint.d/plugins \
&& rm /tmp/tflint-ruleset-aws.zip
RUN wget -O /tmp/tflint-ruleset-azurerm.zip https://github.com/terraform-linters/tflint-ruleset-azurerm/releases/download/v"${AZURERM_VERSION}"/tflint-ruleset-azurerm_"${TARGETOS}"_"${TARGETARCH}".zip \
&& unzip /tmp/tflint-ruleset-azurerm.zip -d ~/.tflint.d/plugins \
&& rm /tmp/tflint-ruleset-azurerm.zip
RUN wget -O /tmp/tflint-ruleset-google.zip https://github.com/terraform-linters/tflint-ruleset-google/releases/download/v"${GOOGLE_VERSION}"/tflint-ruleset-google_"${TARGETOS}"_"${TARGETARCH}".zip \
&& unzip /tmp/tflint-ruleset-google.zip -d ~/.tflint.d/plugins \
&& rm /tmp/tflint-ruleset-google.zip
FROM alpine:3.18.3
LABEL maintainer=terraform-linters
RUN apk add --no-cache ca-certificates
COPY --from=builder /usr/local/bin/tflint /usr/local/bin
COPY --from=builder /root/.tflint.d /root/.tflint.d
ENTRYPOINT ["tflint"]
WORKDIR /data