Skip to content

Commit 1ad1e7d

Browse files
Merge pull request #2 from SparkPost/feature/SD-2079
SD-2079 Try to make our own container from scratch
2 parents 97cd6b5 + 1151245 commit 1ad1e7d

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

image/Dockerfile

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,44 @@
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).*$"
242

343
COPY entrypoints/ /entrypoints/
444
COPY actions.sh /usr/local/actions.sh
@@ -10,3 +50,5 @@ COPY tools/convert_output.py /usr/local/bin/convert_output
1050
COPY tools/plan_cmp.py /usr/local/bin/plan_cmp
1151
COPY tools/convert_version.py /usr/local/bin/convert_version
1252
COPY tools/workspace_exists.py /usr/local/bin/workspace_exists
53+
54+
ENTRYPOINT ["/usr/local/bin/terraform"]

0 commit comments

Comments
 (0)