Files
orion_greptime_proto/Makefile
T
Copilot 246a876568 chore: Use a local Docker builder image for Rust protobuf generation (#320)
* feat: dockerize rust protobuf generation in make and CI

Agent-Logs-Url: https://github.com/GreptimeTeam/greptime-proto/sessions/6438cfba-52ed-4c85-b8fe-1268cc55755a

Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>

* fix: unify make all and CI generation with local builder image

Agent-Logs-Url: https://github.com/GreptimeTeam/greptime-proto/sessions/6438cfba-52ed-4c85-b8fe-1268cc55755a

Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>

* fix: only use custom Docker image for rust target, go/java/cpp use protoc-all directly

Agent-Logs-Url: https://github.com/GreptimeTeam/greptime-proto/sessions/6e6885ee-2919-46f5-9dc5-301c3303888d

Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>

* chore: fix README wording and add --user flag to rust docker run

Agent-Logs-Url: https://github.com/GreptimeTeam/greptime-proto/sessions/3983f532-e5e5-45e4-953d-27bc551ec13d

Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>

* fix: make cargo/rustup dirs world-writable so --user flag works in container

Agent-Logs-Url: https://github.com/GreptimeTeam/greptime-proto/sessions/1bddab48-992c-481b-937f-6698dd9cc067

Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: WenyXu <32535939+WenyXu@users.noreply.github.com>
2026-05-27 20:34:09 +08:00

36 lines
1015 B
Makefile

.PHONY: all rust go go-deps java cpp build-builder-image
PROTOC_CONTAINER=namely/protoc-all:1.51_2
BUILDER_CONTAINER=greptime/protoc-all-local:latest
BUILDER_DOCKERFILE=./docker/protoc-all/Dockerfile
BUILDER_CONTEXT=./docker/protoc-all
all: rust go java cpp
build-builder-image:
docker build -f ${BUILDER_DOCKERFILE} -t ${BUILDER_CONTAINER} ${BUILDER_CONTEXT}
rust: build-builder-image
docker run --rm -t -w /greptime-proto \
--user $(shell id -u):$(shell id -g) \
--entrypoint ./scripts/generate-rust.sh \
-v ${PWD}:/greptime-proto ${BUILDER_CONTAINER}
go: go-deps
docker run --rm -t -w /greptime-proto \
--entrypoint ./scripts/generate-go.sh \
-v ${PWD}:/greptime-proto ${PROTOC_CONTAINER}
go-deps:
go mod download
java:
docker run --rm -t -w /greptime-proto \
--entrypoint ./scripts/generate-java.sh \
-v ${PWD}:/greptime-proto ${PROTOC_CONTAINER}
cpp:
docker run --rm -t -w /greptime-proto \
--entrypoint ./scripts/generate-cpp.sh \
-v ${PWD}:/greptime-proto ${PROTOC_CONTAINER}