File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ WORKDIR /workspace
5
5
# Copy the Go Modules manifests
6
6
COPY go.mod go.mod
7
7
COPY go.sum go.sum
8
+ COPY ./Makefile ./Makefile
8
9
RUN go mod download
9
10
10
11
# Copy the Go sources
@@ -13,7 +14,7 @@ COPY pkg/ pkg/
13
14
14
15
# Build
15
16
USER 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
17
18
18
19
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8
19
20
WORKDIR /
Original file line number Diff line number Diff line change @@ -155,6 +155,15 @@ build: fmt vet ## Build manager binary.
155
155
" \
156
156
-o bin/manager main.go
157
157
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
+
158
167
.PHONY : run
159
168
run : manifests fmt vet # # Run a controller from your host.
160
169
go run ./main.go
You can’t perform that action at this time.
0 commit comments