This Docker image contains protoc-gen-go, protoc-gen-validate, and protoc-gen-doc
Please refer to the relevant project for the usage of each project.
Generage Go code by protocol buffer
docker run --rm --name protoc -v $(PWD)/gen/pb:/pb -v $(SCHEMA_PATH)/proto:/schema hizzuu/protoc \
-I/schema \
--go_out=plugins=grpc:/pb \
user.proto
When using protoc-gen-validate
docker run --rm --name protoc -v $(PWD)/gen/pb:/pb -v $(SCHEMA_PATH)/proto:/schema hizzuu/protoc \
-I/schema \
-I/go/pkg/mod/github.com/envoyproxy/protoc-gen-validate@v0.6.2 \
--go_out=plugins=grpc:/pb \
--validate_out="lang=go:/pb" \
user.proto
Generate Document by Protocol Buffers
docker run --rm -v ${PWD}:/proto hizzuu/protoc \
-I/proto \
-I/go/src/github.com/envoyproxy/protoc-gen-validate \
--doc_out=. \
--doc_opt=markdown,README.md \
user.proto
- Clone this repository
- Install dependencies using
Docker build .