From 93f2b1798bdd35e82f4f574919d280a4fb559d21 Mon Sep 17 00:00:00 2001 From: chenzhihui Date: Fri, 19 Dec 2025 11:17:28 +0800 Subject: [PATCH 1/2] feat(plugins): add kratos-http community plugin for v2.9.2 --- plugins/community/kratos-http/source.yaml | 4 ++++ .../community/kratos-http/v2.9.2/.dockerignore | 2 ++ plugins/community/kratos-http/v2.9.2/Dockerfile | 15 +++++++++++++++ .../community/kratos-http/v2.9.2/buf.plugin.yaml | 8 ++++++++ 4 files changed, 29 insertions(+) create mode 100644 plugins/community/kratos-http/source.yaml create mode 100644 plugins/community/kratos-http/v2.9.2/.dockerignore create mode 100644 plugins/community/kratos-http/v2.9.2/Dockerfile create mode 100644 plugins/community/kratos-http/v2.9.2/buf.plugin.yaml diff --git a/plugins/community/kratos-http/source.yaml b/plugins/community/kratos-http/source.yaml new file mode 100644 index 000000000..9e1fe4869 --- /dev/null +++ b/plugins/community/kratos-http/source.yaml @@ -0,0 +1,4 @@ +source: + github: + owner: go-kratos + repository: kratos diff --git a/plugins/community/kratos-http/v2.9.2/.dockerignore b/plugins/community/kratos-http/v2.9.2/.dockerignore new file mode 100644 index 000000000..5d0f124ff --- /dev/null +++ b/plugins/community/kratos-http/v2.9.2/.dockerignore @@ -0,0 +1,2 @@ +* +!Dockerfile diff --git a/plugins/community/kratos-http/v2.9.2/Dockerfile b/plugins/community/kratos-http/v2.9.2/Dockerfile new file mode 100644 index 000000000..e91b3d593 --- /dev/null +++ b/plugins/community/kratos-http/v2.9.2/Dockerfile @@ -0,0 +1,15 @@ +# syntax=docker/dockerfile:1.17 +FROM --platform=$BUILDPLATFORM golang:1.25.0-bookworm AS build + +ARG TARGETOS TARGETARCH +ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH + +RUN --mount=type=cache,target=/go/pkg/mod \ + go install -ldflags="-s -w" -trimpath go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@b9fab9a \ + && mv /go/bin/${GOOS}_${GOARCH}/protoc-gen-go-http /go/bin/protoc-gen-go-http || true + +FROM scratch +COPY --from=build --link --chown=root:root /etc/passwd /etc/passwd +COPY --from=build --link --chown=root:root /go/bin/protoc-gen-go-http . +USER nobody +ENTRYPOINT [ "/protoc-gen-go-http" ] diff --git a/plugins/community/kratos-http/v2.9.2/buf.plugin.yaml b/plugins/community/kratos-http/v2.9.2/buf.plugin.yaml new file mode 100644 index 000000000..e598bc3b8 --- /dev/null +++ b/plugins/community/kratos-http/v2.9.2/buf.plugin.yaml @@ -0,0 +1,8 @@ +version: v1 +name: buf.build/community/kratos-http +plugin_version: v0.7.1 +source_url: https://github.com/go-kratos/kratos/tree/main/cmd/protoc-gen-go-http +integration_guide_url: https://github.com/go-kratos/kratos#getting-started +description: A protoc plugin that generates Kratos HTTP server/client stubs and routing code from protobuf services annotated with HTTP options. +spdx_license_id: MIT +license_url: https://github.com/go-kratos/kratos/blob/main/LICENSE From e425572a52de7f44d79f373320b0709212b4b26b Mon Sep 17 00:00:00 2001 From: chenzhihui Date: Fri, 19 Dec 2025 11:27:36 +0800 Subject: [PATCH 2/2] move kratos-http plugin to go-kratos directory --- plugins/{community/kratos-http => go-kratos/http}/source.yaml | 0 .../kratos-http => go-kratos/http}/v2.9.2/.dockerignore | 0 .../{community/kratos-http => go-kratos/http}/v2.9.2/Dockerfile | 0 .../kratos-http => go-kratos/http}/v2.9.2/buf.plugin.yaml | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename plugins/{community/kratos-http => go-kratos/http}/source.yaml (100%) rename plugins/{community/kratos-http => go-kratos/http}/v2.9.2/.dockerignore (100%) rename plugins/{community/kratos-http => go-kratos/http}/v2.9.2/Dockerfile (100%) rename plugins/{community/kratos-http => go-kratos/http}/v2.9.2/buf.plugin.yaml (100%) diff --git a/plugins/community/kratos-http/source.yaml b/plugins/go-kratos/http/source.yaml similarity index 100% rename from plugins/community/kratos-http/source.yaml rename to plugins/go-kratos/http/source.yaml diff --git a/plugins/community/kratos-http/v2.9.2/.dockerignore b/plugins/go-kratos/http/v2.9.2/.dockerignore similarity index 100% rename from plugins/community/kratos-http/v2.9.2/.dockerignore rename to plugins/go-kratos/http/v2.9.2/.dockerignore diff --git a/plugins/community/kratos-http/v2.9.2/Dockerfile b/plugins/go-kratos/http/v2.9.2/Dockerfile similarity index 100% rename from plugins/community/kratos-http/v2.9.2/Dockerfile rename to plugins/go-kratos/http/v2.9.2/Dockerfile diff --git a/plugins/community/kratos-http/v2.9.2/buf.plugin.yaml b/plugins/go-kratos/http/v2.9.2/buf.plugin.yaml similarity index 100% rename from plugins/community/kratos-http/v2.9.2/buf.plugin.yaml rename to plugins/go-kratos/http/v2.9.2/buf.plugin.yaml