diff --git a/Dockerfile b/Dockerfile index 95b76ea..69c6d0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,21 @@ -# Docker image for the Drone Terraform plugin -# -# docker build --rm=true -t jmccann/drone-terraform:latest . +FROM golang:1.8.0-alpine -FROM alpine:3.4 +ENV TERRAFORM_VERSION 0.8.8 RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" | tee -a /etc/apk/repositories && \ apk -U add \ ca-certificates \ git \ - terraform && \ - rm -rf /var/cache/apk/* + wget && \ + rm -rf /var/cache/apk/* && \ + wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -O terraform.zip && \ + unzip terraform.zip -d /bin && \ + rm -rf /var/cache/apk/* terraform.zip -ADD drone-terraform /bin/ -ENTRYPOINT ["/bin/drone-terraform"] +ADD . /go/src/github.com/jmccann/drone-terraform + +WORKDIR /go/src/github.com/jmccann/drone-terraform + +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go install -a -tags netgo + +ENTRYPOINT ["/go/bin/drone-terraform"]