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.