File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ WORKDIR /workspace
55# Copy the Go Modules manifests
66COPY go.mod go.mod
77COPY go.sum go.sum
8+ COPY ./Makefile ./Makefile
89RUN go mod download
910
1011# Copy the Go sources
@@ -13,7 +14,7 @@ COPY pkg/ pkg/
1314
1415# Build
1516USER root
16- RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags strictfipsruntime -a -o manager main.go
17+ RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 make go- build-for-image
1718
1819FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8
1920WORKDIR /
Original file line number Diff line number Diff line change @@ -155,6 +155,15 @@ build: fmt vet ## Build manager binary.
155155 " \
156156 -o bin/manager main.go
157157
158+ .PHONY : go-build-for-image
159+ go-build-for-image : fmt vet # # Build manager binary.
160+ go build \
161+ -ldflags " \
162+ -X ' main.OperatorVersion=$(BUILD_VERSION)' \
163+ -X ' main.BuildDate=$(BUILD_DATE)' \
164+ " \
165+ -tags strictfipsruntime -a -o manager main.go
166+
158167.PHONY : run
159168run : manifests fmt vet # # Run a controller from your host.
160169 go run ./main.go
You can’t perform that action at this time.
0 commit comments