1
- FROM danielflook/terraform-github-actions-base:latest
1
+ FROM golang:1.12.6 AS tfmask
2
+
3
+ RUN git clone https://github.com/cloudposse/tfmask.git
4
+ RUN cd tfmask && make && make go/build
5
+
6
+ FROM debian:buster-slim as base
7
+
8
+ ARG DEFAULT_TF_VERSION=0.13.1
9
+ ARG TFSWITCH_VERSION=0.8.832
10
+
11
+ # Terraform environment variables
12
+ ENV CHECKPOINT_DISABLE=true
13
+ ENV TF_IN_AUTOMATION=yep
14
+ ENV TF_INPUT=false
15
+ ENV TF_PLUGIN_CACHE_DIR=/usr/local/share/terraform/plugin-cache
16
+
17
+ RUN apt-get update && apt-get install -y \
18
+ git \
19
+ ssh \
20
+ tar \
21
+ gzip \
22
+ ca-certificates \
23
+ curl \
24
+ unzip \
25
+ jq \
26
+ python2 \
27
+ python3 \
28
+ python3-requests \
29
+ python3-pip \
30
+ wget \
31
+ && rm -rf /var/lib/apt/lists/*
32
+
33
+ RUN curl -fsL https://github.com/warrensbox/terraform-switcher/releases/download/${TFSWITCH_VERSION}/terraform-switcher_${TFSWITCH_VERSION}_linux_amd64.tar.gz -o tfswitch.tar.gz \
34
+ && tar -xvf tfswitch.tar.gz \
35
+ && mv tfswitch /usr/local/bin \
36
+ && rm -rf tfswitch \
37
+ && tfswitch $DEFAULT_TF_VERSION
38
+ RUN mkdir -p $TF_PLUGIN_CACHE_DIR
39
+
40
+ COPY --from=tfmask /go/tfmask/release/tfmask /usr/local/bin/tfmask
41
+ ENV TFMASK_RESOURCES_REGEX="(?i)^(random_id|kubernetes_secret|acme_certificate).*$"
2
42
3
43
COPY entrypoints/ /entrypoints/
4
44
COPY actions.sh /usr/local/actions.sh
@@ -10,3 +50,5 @@ COPY tools/convert_output.py /usr/local/bin/convert_output
10
50
COPY tools/plan_cmp.py /usr/local/bin/plan_cmp
11
51
COPY tools/convert_version.py /usr/local/bin/convert_version
12
52
COPY tools/workspace_exists.py /usr/local/bin/workspace_exists
53
+
54
+ ENTRYPOINT ["/usr/local/bin/terraform" ]
0 commit comments