Skip to content

Commit

Permalink
Merge pull request #2 from SparkPost/feature/SD-2079
Browse files Browse the repository at this point in the history
SD-2079 Try to make our own container from scratch
  • Loading branch information
JohnPeacockMessageSystems authored Sep 8, 2020
2 parents 97cd6b5 + 1151245 commit 1ad1e7d
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
FROM danielflook/terraform-github-actions-base:latest
FROM golang:1.12.6 AS tfmask

RUN git clone https://github.com/cloudposse/tfmask.git
RUN cd tfmask && make && make go/build

FROM debian:buster-slim as base

ARG DEFAULT_TF_VERSION=0.13.1
ARG TFSWITCH_VERSION=0.8.832

# Terraform environment variables
ENV CHECKPOINT_DISABLE=true
ENV TF_IN_AUTOMATION=yep
ENV TF_INPUT=false
ENV TF_PLUGIN_CACHE_DIR=/usr/local/share/terraform/plugin-cache

RUN apt-get update && apt-get install -y \
git \
ssh \
tar \
gzip \
ca-certificates \
curl \
unzip \
jq \
python2 \
python3 \
python3-requests \
python3-pip \
wget \
&& rm -rf /var/lib/apt/lists/*

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 \
&& tar -xvf tfswitch.tar.gz \
&& mv tfswitch /usr/local/bin \
&& rm -rf tfswitch \
&& tfswitch $DEFAULT_TF_VERSION
RUN mkdir -p $TF_PLUGIN_CACHE_DIR

COPY --from=tfmask /go/tfmask/release/tfmask /usr/local/bin/tfmask
ENV TFMASK_RESOURCES_REGEX="(?i)^(random_id|kubernetes_secret|acme_certificate).*$"

COPY entrypoints/ /entrypoints/
COPY actions.sh /usr/local/actions.sh
Expand All @@ -10,3 +50,5 @@ COPY tools/convert_output.py /usr/local/bin/convert_output
COPY tools/plan_cmp.py /usr/local/bin/plan_cmp
COPY tools/convert_version.py /usr/local/bin/convert_version
COPY tools/workspace_exists.py /usr/local/bin/workspace_exists

ENTRYPOINT ["/usr/local/bin/terraform"]

0 comments on commit 1ad1e7d

Please sign in to comment.