Skip to content

Commit

Permalink
Bump golang to 1.20.4
Browse files Browse the repository at this point in the history
Since I was bumping the version I decided to move it to
Makefile.variables because it's used in more than one place.

Signed-off-by: Juan-Luis de Sousa-Valadas Castaño <[email protected]>
  • Loading branch information
juanluisvaladas committed May 3, 2023
1 parent 01daa2f commit 19a5193
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Build the manager binary
FROM golang:1.20 as builder
ARG BUILD_IMG
ARG TARGETOS
ARG TARGETARCH

FROM ${BUILD_IMG} as builder

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ run: manifests generate fmt vet ## Run a controller from your host.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
docker build -t ${IMG} .
docker build \
-t ${IMG} \
--build-arg BUILD_IMG=golang:$(GO_VERSION) \
.

k0smotron-image-bundle.tar: docker-build
docker save ${IMG} -o k0smotron-image-bundle.tar
Expand Down Expand Up @@ -195,10 +198,11 @@ clean:
k0smotron-image-bundle.tar \
$(LOCALBIN)

hack/lint/.golangci-lint.stamp: hack/lint/Dockerfile
hack/lint/.golangci-lint.stamp: hack/lint/Dockerfile Makefile.variables
docker build \
-t k0smotron.golangci-lint \
--build-arg GOLANGCILINT_VERSION=1.52.2 \
--build-arg BUILD_IMG=golang:$(GO_VERSION) \
--build-arg GOLANGCILINT_VERSION=$(GOLANGCILINT_VERSION) \
-f hack/lint/Dockerfile \
.
touch -- '$@'
Expand Down
2 changes: 2 additions & 0 deletions Makefile.variables
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
KUSTOMIZE_VERSION ?= v5.0.1
CONTROLLER_TOOLS_VERSION ?= v0.11.4
GO_VERSION ?= 1.20.4
GOLANGCILINT_VERSION ?= 1.52.2
5 changes: 3 additions & 2 deletions hack/lint/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM golang:1.20 as builder
ARG BUILD_IMG

FROM ${BUILD_IMG} as builder
ARG GOLANGCILINT_VERSION

RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v${GOLANGCILINT_VERSION}
RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v${GOLANGCILINT_VERSION}

0 comments on commit 19a5193

Please sign in to comment.