From dd614881b6c17696e880ef11110b287f14b6d92d Mon Sep 17 00:00:00 2001 From: Khaled Elkhawaga Date: Fri, 22 Nov 2019 17:27:28 +0100 Subject: [PATCH] Fix Docker build failure (#149) * Enables module-mode in Docker to fix build * Statically compile binary in Docker to fix missing dependency errors * Ensure target OS is set to Linux for Docker builds --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 7a142e6b..89e04a66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ FROM golang:1.12 as builder +ENV GO111MODULE=on +ENV CGO_ENABLED=0 +ENV GOOS=linux WORKDIR /go/src/github.com/cloudflare/cloudflared/ RUN apt-get update && apt-get install -y --no-install-recommends upx # Run after `apt-get update` to improve rebuild scenarios