From c1209acb27521252057da9bb1fdb703bd16fbfb7 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Tue, 13 May 2025 18:13:58 +0200 Subject: [PATCH] hack: modernize-fix bake target Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- docker-bake.hcl | 7 +++++++ hack/dockerfiles/lint.Dockerfile | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/docker-bake.hcl b/docker-bake.hcl index a3576c73..fd5ee7b4 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -73,6 +73,13 @@ target "lint-gopls" { target = "gopls-analyze" } +target "modernize-fix" { + inherits = ["_common"] + dockerfile = "./hack/dockerfiles/lint.Dockerfile" + target = "modernize-fix" + output = ["."] +} + target "validate-vendor" { inherits = ["_common"] dockerfile = "./hack/dockerfiles/vendor.Dockerfile" diff --git a/hack/dockerfiles/lint.Dockerfile b/hack/dockerfiles/lint.Dockerfile index 14e8a5bc..e69dbaca 100644 --- a/hack/dockerfiles/lint.Dockerfile +++ b/hack/dockerfiles/lint.Dockerfile @@ -92,4 +92,25 @@ RUN --mount=target=. \ done EOF +FROM base AS modernize-fix-run +COPY --link --from=xx / / +ARG TARGETNAME +ARG TARGETPLATFORM +WORKDIR /go/src/github.com/docker/buildx +RUN --mount=target=.,rw \ + --mount=target=/root/.cache,type=cache,id=lint-cache-${TARGETNAME}-${TARGETPLATFORM} \ + --mount=target=/gopls-analyzers,from=gopls,source=/out <