Skip to content

Commit 59667e1

Browse files
authored
Merge pull request #2557 from Nordix/lentzi90/release-0.11-security-scan
🌱 Make security scanners happy release-0.11
2 parents 71632c5 + dfcf745 commit 59667e1

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.trivyignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# These require updating the go version to 1.23.
2+
# According to govulncheck we are not using code that is affected by them anyway
3+
CVE-2025-22870
4+
CVE-2025-22872

Dockerfile

Lines changed: 7 additions & 6 deletions
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.22.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
@@ -30,7 +31,7 @@ COPY orc/go.sum orc/go.sum
3031
# Cache deps before building and copying source so that we don't need to re-download as much
3132
# and so that source changes don't invalidate our downloaded layer
3233
RUN --mount=type=cache,target=/go/pkg/mod \
33-
go mod download
34+
go mod download
3435

3536
# Copy the sources
3637
COPY ./ ./
@@ -42,10 +43,10 @@ ARG ldflags
4243

4344
# Do not force rebuild of up-to-date packages (do not use -a) and use the compiler cache folder
4445
RUN --mount=type=cache,target=/root/.cache/go-build \
45-
--mount=type=cache,target=/go/pkg/mod \
46-
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
47-
go build -ldflags "${ldflags} -extldflags '-static'" \
48-
-o manager ${package}
46+
--mount=type=cache,target=/go/pkg/mod \
47+
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
48+
go build -ldflags "${ldflags} -extldflags '-static'" \
49+
-o manager ${package}
4950

5051
# Production image
5152
FROM gcr.io/distroless/static:nonroot

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ unexport GOPATH
2727
TRACE ?= 0
2828

2929
# Go
30-
GO_VERSION ?= 1.22.7
30+
GO_VERSION ?= 1.22.12
3131

3232
# Directories.
3333
ARTIFACTS ?= $(REPO_ROOT)/_artifacts
@@ -359,7 +359,7 @@ generate-api-docs-%: $(GEN_CRD_API_REFERENCE_DOCS) FORCE
359359

360360
.PHONY: docker-build
361361
docker-build: ## Build the docker image for controller-manager
362-
docker build -f Dockerfile --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CONTROLLER_IMG_TAG)
362+
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)
363363

364364
.PHONY: docker-push
365365
docker-push: ## Push the docker image

0 commit comments

Comments
 (0)