-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
52 lines (36 loc) · 1.66 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# ---------------------------------------------------------------------------------------------------------------------
# Terraform Build Image
# FROM golang:alpine as Build
FROM golang:1.12.1-alpine as Build
ENV TERRAFORM_VERSION=0.12.19
ENV DDCLOUD_VERSION=3.0
RUN apk add --update git bash openssh make
ENV TF_DEV=true
ENV TF_RELEASE=true
## Terraform
WORKDIR $GOPATH/src/github.com/hashicorp/terraform
RUN git clone https://github.com/hashicorp/terraform.git ./ && \
git checkout v${TERRAFORM_VERSION} && \
/bin/bash scripts/build.sh && \
ls -l /bin
## DDCloud Provider
WORKDIR $GOPATH/src/github.com/DimensionDataResearch/dd-cloud-compute-terraform
RUN git clone https://github.com/DimensionDataResearch/dd-cloud-compute-terraform.git ./ && \
# git checkout v${DDCLOUD_VERSION} && \
git checkout development/v${DDCLOUD_VERSION} && \
go get github.com/pkg/errors && \
go get golang.org/x/crypto/pkcs12 && \
go get github.com/DimensionDataResearch/go-dd-cloud-compute/compute && \
make dev
# ---------------------------------------------------------------------------------------------------------------------
# Create Minimal Image
FROM alpine
RUN apk add --update git bash openssh curl
COPY --from=build /go/bin/terraform /bin
COPY --from=build /usr/local/bin/terraform-provider-ddcloud /bin
## Kubectl binadry download (The K8s/Helm Terraform providers are not yet able to perform all the configuration required during a deployment)
RUN wget https://storage.googleapis.com/kubernetes-release/release/v1.15.3/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl
WORKDIR /bin
ENTRYPOINT ["terraform"]