https://github.com/renderedtext/docker-protoc
https://github.com/renderedtext/docker-protoc
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/renderedtext/docker-protoc
- Owner: renderedtext
- Created: 2021-04-02T11:36:00.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-27T17:14:14.000Z (about 2 years ago)
- Last Synced: 2025-04-17T12:43:29.863Z (about 1 year ago)
- Language: Makefile
- Size: 23.4 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dockerized Protoc
This repository holds receipts for production of Dockerized `protoc` plugin for Elixir.
We use these Docker images in the development process accross our Elixir projects
in order to make sure that every team member uses the same `protoc` version.
## Usage
Docker run should be executed with the following options set:
- assign local directories to the following Docker container volumes `/home/protoc/code` and `/home/protoc/source`
- `/home/protoc/code` - working directory (`$PWD` in the following example)
- `/home/protoc/source` - directory that contains already generated protos (`$TMP_PROTO_DIR`)
- specify the protos output path within your local environment (`$PROTO_OUTPUT_DIR`)
- specify Docker container path of the target `proto` file (ie. file that needs to be compiled with `protoc` and is present in `$TMP_PROTO_DIR` locally; eg. `/home/protoc/source/user.proto`)
- specify Docker protoc image tag (`$PROTOC_IMG_VSN`); when not specified `latest` will be used
``` bash
docker run --rm -v $PWD:/home/protoc/code -v $TMP_PROTO_DIR:/home/protoc/source \
renderedtext/protoc:$PROTOC_IMG_VSN protoc -I /home/protoc/source -I /home/protoc/source/include \
--elixir_out=plugins=grpc:$PROTO_OUTPUT_DIR \
--plugin=/root/.mix/escripts/protoc-gen-elixir /home/protoc/source/user.proto
```
## Deployment
New Docker image deployment is managed with the following promotions
within [`docker-protoc`] Semaphore project:
- parametrized promotion
- legacy promotion
Resulting Docker images are tagged (as described below) and pushed to Dockerhub repository ([`renderedtext/protoc`]).
### Parametrized promotion
Available parameters:
- Elixir version (required, default `v1.11.4`)
- `protoc` version (required, default `3.17.3`) latest version can be found here: https://github.com/protocolbuffers/protobuf/tags
- Protobuf version (optional)
This promotion constructs a tag in the following form:
`--`
### Legacy promotion
This promotion relies on `make build` and `make push` target sequences.
Produced image is pushed to repository with `latest` and `git commit sha` tags.
It is based on `Elixir v1.8.2`, `Protobuf v0.5.4` and `protoc v3.3.0`.
This image is used by some of projects in the production (eg. UI project [`front`]).
[`docker-protoc`]: https://semaphore.semaphoreci.com/projects/docker-protoc
[`renderedtext/protoc`]: https://hub.docker.com/repository/docker/renderedtext/protoc
[`front`]: https://semaphore.semaphoreci.com/projects/front