Skip to content

Commit

Permalink
Apply the new build method in Dockerfile and Makefile
Browse files Browse the repository at this point in the history
New build method for FAR
  • Loading branch information
razo7 committed Mar 20, 2023
1 parent 6ba052d commit 2de1456
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2de1456

Please sign in to comment.