Protoc v2
Docker image of old version of protobuf for generating sources using .proto files with syntax = "proto2
Look at my docker-hub repository for actual images:
https://hub.docker.com/repository/docker/atanava/protoc-2.6.1/general
docker run --rm --name protoc2 \
--env LANG=java \
-v <absolute path to .proto files folder on host>:/protobuf \
-v <absolute path to generated files folder on host>:/protobuf/output \
-w /protobuf \
atanava/protoc-2.6.1:0.0.1
docker run --rm --name protoc2 \
--env LANG=java \
-v /home/username/myproject/src/main/resources/protobuf:/protobuf \
-v /home/username/myproject/src/main/java:/protobuf/output \
-w /protobuf \
atanava/protoc-2.6.1:0.0.1
Other languages wasn't tested yet, but you can try it by replacing --env LANG=java with another language.
After executing of docker run
command, your generated files will be placed to new subfolder output
of source folder you mentioned in docker run command.
But only root user of created container will became an owner of this folder.
Use chown command on host to get write access to these files.