From bd61ee2c9e361c3d23405027de4dbc2cf2bf059e Mon Sep 17 00:00:00 2001 From: c-mckenzie Date: Fri, 24 May 2019 11:01:40 +1000 Subject: [PATCH] Update to latest DDCloud Provider and base image --- Dockerfile | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 12c900b..2daae9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,52 @@ -FROM golang:alpine as Build +# --------------------------------------------------------------------------------------------------------------------- +# Terraform Build Image -ENV TERRAFORM_VERSION=0.11.7 -ENV DDCLOUD_VERSION=1.3 +# FROM golang:alpine as Build +FROM golang:1.12.1-alpine as Build + +ENV TERRAFORM_VERSION=0.11.14 +ENV DDCLOUD_VERSION=2.2.1 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 release/v${DDCLOUD_VERSION} && \ + 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 -FROM golang:alpine -COPY --from=build $GOPATH/bin/terraform /bin -COPY --from=build $GOPATH/src/github.com/DimensionDataResearch/dd-cloud-compute-terraform/_bin/terraform-provider-ddcloud /bin -WORKDIR $GOPATH +# --------------------------------------------------------------------------------------------------------------------- +# Create Minimal Image + +FROM alpine +RUN apk add --update git bash openssh curl +COPY --from=build /go/bin/terraform /bin +COPY --from=build /go/src/github.com/DimensionDataResearch/dd-cloud-compute-terraform/_bin/terraform-provider-ddcloud /bin + + +## Kubectl (The K8s/Helm providers are not yet able to perform all the configuration required during a deployment) +RUN wget https://storage.googleapis.com/kubernetes-release/release/v1.14.1/bin/linux/amd64/kubectl && \ + chmod +x ./kubectl && \ + mv ./kubectl /usr/local/bin/kubectl + +WORKDIR /bin -ENTRYPOINT ["terraform"] \ No newline at end of file +ENTRYPOINT ["terraform"]