| FROM golang:1.24.4-alpine@sha256:68932fa6d4d4059845c8f40ad7e654e626f3ebd3706eef7846f319293ab5cb7a AS jsonschema-builder
ADD hack/jsonschema/go.* hack/jsonschema/tools.go tools/
# the specific versions of these tools are in hack/go.mod so that Dependabot can bump them for updates
RUN cd tools && go build --trimpath -o /usr/local/bin/protoc-gen-jsonschema github.com/chrusty/protoc-gen-jsonschema/cmd/protoc-gen-jsonschema
FROM gcr.io/distroless/static-debian12:nonroot@sha256:627d6c5a23ad24e6bdff827f16c7b60e0289029b0c79e9f7ccd54ae3279fb45f
COPY --from=jsonschema-builder /usr/local/bin/protoc-gen-jsonschema /usr/local/bin/
COPY --from=protoc-base:jsonschema /protobuf/bin/protoc /usr/local/bin/
COPY --from=protoc-base:jsonschema /protobuf/include/google /opt/include/google
COPY --from=protoc-base:jsonschema /googleapis /googleapis
ENTRYPOINT ["/usr/local/bin/protoc", "--plugin=protoc-gen-jsonschema=/usr/local/bin/protoc-gen-jsonschema" ]
 |