-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
30 lines (24 loc) · 1.09 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
FROM hashicorp/terraform:0.11.14
ARG PROVIDER
ENV PROVIDER ${PROVIDER}
LABEL name=mesosphere/dcos-terraform-${PROVIDER}
ARG DCOS_TERRAFORM_MODULE_VERSION
ENV DCOS_TERRAFORM_MODULE_VERSION ${DCOS_TERRAFORM_MODULE_VERSION}
LABEL version=${DCOS_TERRAFORM_MODULE_VERSION}
ENV TF_PLUGIN_CACHE_DIR /var/lib/terraform/plugin-cache
RUN mkdir -p ${TF_PLUGIN_CACHE_DIR}
WORKDIR /dcos-terraform
RUN mkdir -p /dcos-terraform/tfstate && chmod 777 /dcos-terraform/tfstate
VOLUME /dcos-terraform/tfstate
COPY empty_ee_license_file.txt /dcos-terraform/empty_ee_license_file.txt
COPY main.${PROVIDER}.tf main.tf
COPY variables.${PROVIDER}.tf variables.tf
COPY dcos_core_variables.${PROVIDER}.tf dcos_core_variables.tf
COPY outputs_infra_module.${PROVIDER}.tf outputs_infra_module.tf
COPY outputs.${PROVIDER}.tf outputs.tf
COPY helper-variables.tf ./
RUN sed -i "s/__DCOS_TERRAFORM_MODULE_VERSION__/${DCOS_TERRAFORM_MODULE_VERSION}/" main.tf
RUN terraform init -get=true -get-plugins=true
RUN chmod -R 777 /dcos-terraform ${TF_PLUGIN_CACHE_DIR}
COPY terraform-wrapper.sh /terraform-wrapper.sh
ENTRYPOINT ["/terraform-wrapper.sh"]