-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathDockerfile-0.11
118 lines (100 loc) · 5.31 KB
/
Dockerfile-0.11
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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
ARG TF_VERSIONS="0.11.12 0.11.13 0.11.14"
ARG GCLOUD_VERSION=314.0.0
ARG AWSCLI_VERSION=1.17.11
ARG HELM_VERSION=2.16.9
ARG TFSWITCH_VERSION=0.13.1275
ARG TF_HELM_VERSIONS="0.6.0 0.5.1 0.5.0 0.4.0 0.3.2 0.3.1 0.3.0 0.2.0 0.1.0"
ARG TF_ACME_VERSIONS="1.0.0 0.6.0 0.5.0 0.4.0 0.3.0"
ARG TF_AIVEN_VERSIONS="1.0.19 1.0.20 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4"
ARG TF_OLD_AIVEN_VERSIONS="1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.0.10 1.0.11 1.0.12 1.0.13 1.0.15 1.0.16 1.0.17 1.0.18"
ARG TF_OVO_VERSIONS="1.0.0 1.1.0 1.9.9"
ARG TF_AIVEN_KAFKA_USERS_VERSIONS="0.0.1 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.0.10 1.1.0 1.1.1 1.1.2"
# 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 \
&& for TF_VERSION in $TF_VERSIONS; do \
tfswitch $TF_VERSION; \
done
RUN mkdir -p $TF_PLUGIN_CACHE_DIR
RUN mkdir -p /root/.terraform.d/plugins \
&& curl -fsL https://s3-eu-west-1.amazonaws.com/terraform-provider-aiven/master/terraform-provider-aiven_linux_amd64.zip \
-o terraform-provider-aiven_linux_amd64.zip \
&& unzip terraform-provider-aiven_linux_amd64.zip \
&& mv terraform-provider-aiven_v0.0.1 /root/.terraform.d/plugins/terraform-provider-aiven_v0.0.1 \
&& rm -rf terraform*
RUN mkdir -p /root/aiven \
&& for TF_AIVEN_VERSION in $TF_OLD_AIVEN_VERSIONS; do \
curl -f -L "https://github.com/aiven/terraform-provider-aiven/releases/download/v${TF_AIVEN_VERSION}/terraform-provider-aiven-linux_amd64" \
-o /root/aiven/terraform-provider-aiven_v${TF_AIVEN_VERSION} \
&& chmod +x /root/aiven/terraform-provider-aiven_v${TF_AIVEN_VERSION}; \
done \
&& for TF_AIVEN_VERSION in $TF_AIVEN_VERSIONS; do \
curl -f -L "https://github.com/aiven/terraform-provider-aiven/releases/download/v${TF_AIVEN_VERSION}/terraform-provider-aiven-linux-amd64_v${TF_AIVEN_VERSION}" \
-o /root/aiven/terraform-provider-aiven_v${TF_AIVEN_VERSION} \
&& chmod +x /root/aiven/terraform-provider-aiven_v${TF_AIVEN_VERSION}; \
done
RUN curl -fsL "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" | tar -xzvf- \
&& mv linux-amd64/helm /usr/local/bin/helm \
&& rm -rf helm*.tar.gz linux-amd64/ \
&& helm init --stable-repo-url=https://charts.helm.sh/stable --client-only
ENV HELM_HOME /root/.helm
# This is extremely slow for some reason
RUN for TF_HELM_VERSION in $TF_HELM_VERSIONS; do \
curl -f -L "https://github.com/terraform-providers/terraform-provider-helm/releases/download/v${TF_HELM_VERSION}/terraform-provider-helm_v${TF_HELM_VERSION}_linux_amd64.tar.gz" | tar -xzvf- \
&& mv terraform-provider-helm_linux_amd64/terraform-provider-helm /root/.terraform.d/plugins/terraform-provider-helm_v${TF_HELM_VERSION} \
&& rm -rf terraform-provider-helm*; \
done
# acme provider
RUN for TF_ACME_VERSION in $TF_ACME_VERSIONS; do \
curl -f -L https://github.com/vancluever/terraform-provider-acme-old/releases/download/v${TF_ACME_VERSION}/terraform-provider-acme_v${TF_ACME_VERSION}_linux_amd64.zip -o acme.zip \
&& unzip acme.zip -d /root/.terraform.d/plugins \
&& rm acme.zip \
&& mv /root/.terraform.d/plugins/terraform-provider-acme /root/.terraform.d/plugins/terraform-provider-acme_v${TF_ACME_VERSION}; \
done
# ovo provider
RUN for TF_OVO_VERSION in $TF_OVO_VERSIONS; do \
curl -f -L https://kafka-users-prod-tf-provider.s3-eu-west-1.amazonaws.com/terraform-provider-ovo/${TF_OVO_VERSION}/terraform-provider-ovo_${TF_OVO_VERSION}_linux_amd64.zip -o ovo.zip \
&& unzip ovo.zip -d /root/.terraform.d/plugins \
&& rm ovo.zip; \
done
# aiven_kafka_users provider
RUN for TF_AIVEN_KAFKA_USERS_VERSION in $TF_AIVEN_KAFKA_USERS_VERSIONS; do \
curl -f -L https://kafka-users-prod-tf-provider.s3-eu-west-1.amazonaws.com/terraform-provider-aiven-kafka-users/${TF_AIVEN_KAFKA_USERS_VERSION}/terraform-provider-aiven-kafka-users_${TF_AIVEN_KAFKA_USERS_VERSION}_linux_amd64.zip -o aiven-kafka-users.zip \
&& unzip aiven-kafka-users.zip -d /root/.terraform.d/plugins \
&& rm aiven-kafka-users.zip; \
done
RUN curl -fsL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_VERSION}-linux-x86_64.tar.gz -o /opt/google-cloud-sdk.tar.gz \
&& cd /opt; tar -xf google-cloud-sdk.tar.gz \
&& rm google-cloud-sdk.tar.gz
ENV PATH "/opt/google-cloud-sdk/bin:$PATH"
RUN pip3 install awscli==$AWSCLI_VERSION
COPY --from=tfmask /go/tfmask/release/tfmask /usr/local/bin/tfmask
ENV TFMASK_RESOURCES_REGEX="(?i)^(random_id|kubernetes_secret|acme_certificate).*$"
ENV TFENV="0.11"
COPY compact_plan.py /usr/local/bin/compact_plan
ENTRYPOINT ["/usr/local/bin/terraform"]