From 3abf447b4757fffd291faa15dfa7f11264bb3521 Mon Sep 17 00:00:00 2001 From: Volker Thiel Date: Tue, 25 Feb 2020 19:04:42 +0100 Subject: [PATCH] Build Go binary inside Docker (#22) * Build Go binary inside Docker You can (and should) use Docker to build Go programs. With this updated `Dockerfile` you can build the binary with one simple command `docker build -t your-image-name:tag .`, then push it to your favorite registry and use it in the Helm chart. * Update Dockerfile from origin --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4cadeb1..91975e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,8 @@ +FROM golang:alpine AS build +WORKDIR /app +ADD . /app +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/ingress-controller ./cmd/caddy + FROM alpine:latest as certs RUN apk --update add ca-certificates