From f88b8dfe0436102d247a323aa4c30abde26f77d2 Mon Sep 17 00:00:00 2001 From: razo7 Date: Mon, 20 Mar 2023 10:50:58 +0200 Subject: [PATCH] Apply the new build method in Dockerfile and Makefile New build method for FAR --- Dockerfile | 11 ++++++----- Makefile | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6578ce9d..2b2ff3ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,19 +13,20 @@ WORKDIR / # Copy the Go Modules manifests COPY go.mod go.mod COPY go.sum go.sum -# cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN go mod download - # Copy the go source COPY main.go main.go COPY api/ api/ COPY controllers/ controllers/ +COPY hack/ hack/ COPY pkg/ pkg/ +COPY version/ version/ + +# for getting version info +COPY .git/ .git/ # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go +RUN ./hack/build.sh # Add Fence Agents RUN dnf install -y fence-agents-all diff --git a/Makefile b/Makefile index c710d310..53985126 100644 --- a/Makefile +++ b/Makefile @@ -183,8 +183,8 @@ test-no-verify: manifests generate go-verify fmt vet envtest ginkgo # Generate a ##@ Build .PHONY: build -build: generate fmt vet ## Build manager binary. - go build -o bin/manager main.go +build: ## Build manager binary. + ./hack/build.sh .PHONY: run run: manifests generate fmt vet ## Run a controller from your host.