diff --git a/Makefile b/Makefile index dcd3af9ab..6ea443823 100644 --- a/Makefile +++ b/Makefile @@ -125,6 +125,6 @@ docs: docs-dockerfile: $(BUILDX_CMD) bake docs-dockerfile -.PHONY: mod-outdated -mod-outdated: - $(BUILDX_CMD) bake mod-outdated +.PHONY: gomod-updates +gomod-updates: + $(BUILDX_CMD) bake gomod-updates diff --git a/docker-bake.hcl b/docker-bake.hcl index 52b257dce..0384ce92b 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -428,11 +428,11 @@ target "docs-dockerfile" { output = ["./frontend/dockerfile/docs/rules"] } -target "mod-outdated" { +target "gomod-updates" { inherits = ["_common"] dockerfile = "./hack/dockerfiles/vendor.Dockerfile" - target = "outdated" - no-cache-filter = ["outdated"] + target = "gomod-updates" + no-cache-filter = ["gomod-updates"] output = ["type=cacheonly"] } diff --git a/hack/dockerfiles/vendor.Dockerfile b/hack/dockerfiles/vendor.Dockerfile index ec3be93c2..45dc8660d 100644 --- a/hack/dockerfiles/vendor.Dockerfile +++ b/hack/dockerfiles/vendor.Dockerfile @@ -2,7 +2,6 @@ ARG GO_VERSION=1.26 ARG ALPINE_VERSION=3.23 -ARG MODOUTDATED_VERSION=v0.9.0 FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base RUN apk add --no-cache git rsync @@ -38,11 +37,8 @@ RUN --mount=target=/context \ fi EOT -FROM --platform=linux/amd64 psampaz/go-mod-outdated:${MODOUTDATED_VERSION} AS go-mod-outdated-amd64 - -FROM go-mod-outdated-amd64 AS go-mod-outdated -FROM base AS outdated +FROM base AS gomod-updates RUN --mount=target=.,rw \ --mount=target=/go/pkg/mod,type=cache \ - --mount=from=go-mod-outdated,source=/usr/bin/go-mod-outdated,target=/usr/bin/go-mod-outdated \ - go list -mod=mod -u -m -json all | go-mod-outdated -update -direct + --mount=from=crazymax/gomod-updates,source=/usr/bin/gomod-updates,target=/usr/bin/gomod-updates \ + gomod-updates --update --direct --major