mirror of
https://github.com/thegeeklab/wp-opentofu.git
synced 2024-06-03 04:49:42 +02:00
Merge pull request #48 from PressLabs/docker-multistage-build
Build using Dockerfile multistage feature
This commit is contained in:
commit
3930fcbee0
|
@ -1,6 +1,12 @@
|
|||
# Docker image for the Drone Terraform plugin
|
||||
#
|
||||
# docker build --rm=true -t jmccann/drone-terraform:latest .
|
||||
FROM golang:1.8-alpine AS builder
|
||||
COPY ./*.go ./src/
|
||||
COPY ./vendor/ ./src/
|
||||
RUN set -ex \
|
||||
&& cd ./src \
|
||||
&& CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -o /go/bin/drone-terraform
|
||||
|
||||
FROM alpine:3.4
|
||||
|
||||
|
@ -15,5 +21,5 @@ RUN wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraf
|
|||
unzip terraform.zip -d /bin && \
|
||||
rm -f terraform.zip
|
||||
|
||||
ADD drone-terraform /bin/
|
||||
COPY --from=builder /go/bin/drone-terraform /bin/
|
||||
ENTRYPOINT ["/bin/drone-terraform"]
|
||||
|
|
Loading…
Reference in New Issue
Block a user