-
Notifications
You must be signed in to change notification settings - Fork 0
/
DockerFile
31 lines (26 loc) · 1.18 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
31
# Can be executed as docker build https://github.com/acmcg/hybrid.git -t terraform:latest
# Indicates that the windowsservercore image will be used as the base image.
FROM microsoft/windowsservercore
#FROM microsoft/nanoserver
# Metadata indicating an image maintainer.
LABEL maintainer="[email protected]"
# Download the Terraform package.
RUN powershell.exe -Command invoke-command -ScriptBlock { \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
invoke-webrequest https://releases.hashicorp.com/terraform/0.11.10/terraform_0.11.10_windows_amd64.zip -OutFile terraform.zip ;\
expand-archive terraform.zip -DestinationPath c:\terraform -Force;\
Remove-Item -Force terraform.zip \
}
#initialize terraform directory
COPY *.tf c:/terraform/
COPY *.tfstate c:/terraform/
COPY *.tfvars c:/terraform/
RUN cd c:\terraform && terraform init
#Install Azure CLI
RUN powershell.exe -Command invoke-command -ScriptBlock { \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; \
invoke-webrequest https://aka.ms/installazurecliwindows -OutFile azurecli.msi ; \
}
RUN msiexec /i "azurecli.msi" /qn
#Set working directory
WORKDIR c:\\terraform