pseudomuto / protoc-gen-doc

Documentation generator plugin for Google Protocol Buffers
MIT License
2.59k stars 462 forks source link

Could not make proto path relative: protos/*.proto: No such file or directory #516

Open pcimring opened 1 year ago

pcimring commented 1 year ago

Hi

I'm something of a newcomer to gRPC in general, as well as this plugin and Docker :)

I downloaded the Docker image to my MacBook (as per the Readme) and attempted to start it:

docker run pseudomuto/protoc-gen-do

But I get:

Could not make proto path relative: protos/*.proto: No such file or directory

Any advice? Am I missing something here?

Thanks

ismailseyfi commented 1 year ago

I have the same issue with Mac.

a-mironenko-dataart commented 1 year ago

@pcimring @ismailseyfi The trick is to mount your files to a place inside the docker container you're running using the -v flag. So, assuming I'm in a directory with some file.proto:

❯$ ls 
file.proto

I'd run this:

docker run --rm -v ./docs:/out -v ./:/protos pseudomuto/protoc-gen-doc

... to generate docs in the ./docs subdirectory, like this:

❯$ tree 
.
├── doc
│   ├── index.html
└── file.proto

Hope it helps

cctyl commented 10 months ago

@pcimring @ismailseyfi The trick is to mount your files to a place inside the docker container you're running using the -v flag. So, assuming I'm in a directory with some file.proto:

❯$ ls 
file.proto

I'd run this:

docker run --rm -v ./docs:/out -v ./:/protos pseudomuto/protoc-gen-doc

... to generate docs in the ./docs subdirectory, like this:

❯$ tree 
.
├── doc
│   ├── index.html
└── file.proto

Hope it helps

If my .proto file is not in the same directory (because our project’s proto file directory corresponds to the package), and there is an uncertain hierarchical directory structure, how should I modify this command?

CaetanoJS commented 6 months ago

@pcimring @ismailseyfi any updates about this issue?