2016-07-05 18:23:41 +00:00
|
|
|
# Docker image for the Drone Terraform plugin
|
2015-11-09 19:23:42 +00:00
|
|
|
#
|
2017-05-30 14:47:32 +00:00
|
|
|
# docker build -t jmccann/drone-terraform:latest .
|
2019-09-06 13:53:49 +00:00
|
|
|
FROM golang:1.13-alpine AS builder
|
2019-02-22 14:40:57 +00:00
|
|
|
|
|
|
|
RUN apk add --no-cache git
|
|
|
|
|
|
|
|
WORKDIR /tmp/drone-terraform
|
|
|
|
|
2019-07-12 12:55:47 +00:00
|
|
|
COPY go.mod go.mod
|
|
|
|
COPY go.sum go.sum
|
2019-02-22 14:40:57 +00:00
|
|
|
RUN go mod download
|
2019-07-12 12:55:47 +00:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2019-02-22 14:40:57 +00:00
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o /go/bin/drone-terraform
|
2015-11-09 19:23:42 +00:00
|
|
|
|
2020-01-31 11:19:42 +00:00
|
|
|
FROM alpine:3.11
|
2015-11-10 13:56:18 +00:00
|
|
|
|
2020-01-31 11:18:36 +00:00
|
|
|
RUN apk add --no-cache \
|
2016-07-05 18:23:41 +00:00
|
|
|
ca-certificates \
|
|
|
|
git \
|
2018-06-22 20:16:11 +00:00
|
|
|
wget \
|
2020-02-06 13:59:34 +00:00
|
|
|
curl \
|
2020-01-31 11:18:36 +00:00
|
|
|
openssh-client
|
2015-11-10 13:56:18 +00:00
|
|
|
|
2019-08-05 15:46:47 +00:00
|
|
|
ARG terraform_version
|
|
|
|
RUN wget -q https://releases.hashicorp.com/terraform/${terraform_version}/terraform_${terraform_version}_linux_amd64.zip -O terraform.zip && \
|
2017-04-07 14:39:10 +00:00
|
|
|
unzip terraform.zip -d /bin && \
|
|
|
|
rm -f terraform.zip
|
|
|
|
|
2017-07-21 15:42:39 +00:00
|
|
|
COPY --from=builder /go/bin/drone-terraform /bin/
|
2015-11-09 19:23:42 +00:00
|
|
|
ENTRYPOINT ["/bin/drone-terraform"]
|