Skip to content

Commit 294136e

Browse files
feat: use specified go version for docker build
1 parent 88f5c66 commit 294136e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# limitations under the License.
1414

1515
# Build the manager binary
16-
FROM golang:1.23.0 AS builder
16+
ARG GO_VERSION
17+
FROM golang:${GO_VERSION} as builder
1718
WORKDIR /workspace
1819

1920
# Run this with docker build --build_arg goproxy=$(go env GOPROXY) to override the goproxy

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ generate-api-docs-%: $(GEN_CRD_API_REFERENCE_DOCS) FORCE
330330

331331
.PHONY: docker-build
332332
docker-build: ## Build the docker image for controller-manager
333-
docker build -f Dockerfile --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CONTROLLER_IMG_TAG)
333+
docker build -f Dockerfile --build-arg GO_VERSION=$(GO_VERSION) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CONTROLLER_IMG_TAG)
334334

335335
.PHONY: docker-push
336336
docker-push: ## Push the docker image

0 commit comments

Comments
 (0)