Skip to content

Commit c60f190

Browse files
authored
Merge pull request #2337 from simonostendorf/feat/use-specified-go-version-for-docker-build
✨ feat: use specified go version for docker build
2 parents 05774bc + 26f3cb4 commit c60f190

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export GO111MODULE=on
2424
unexport GOPATH
2525

2626
# Go
27-
GO_VERSION ?= 1.22.7
27+
GO_VERSION ?= 1.23.0
2828

2929
# Directories.
3030
ARTIFACTS ?= $(REPO_ROOT)/_artifacts
@@ -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)