Skip to content

Commit

Permalink
build protobuf in dockerfile for all services (open-telemetry#1386)
Browse files Browse the repository at this point in the history
* generate protobuf in docker build for accountingservice, checkoutservice, currencyservice, and productcatalogservice

* fix build context

---------

Co-authored-by: Austin Parker <[email protected]>
Co-authored-by: Pierre Tessier <[email protected]>
  • Loading branch information
3 people committed Mar 7, 2024
1 parent e82863b commit 0c80094
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 14,202 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
setup-qemu: true
- file: ./src/currencyservice/Dockerfile
tag_suffix: currencyservice
context: ./src/currencyservice
context: ./
setup-qemu: true
- file: ./src/emailservice/Dockerfile
tag_suffix: emailservice
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ test/tracetesting/tracetesting-vars.yaml
/src/paymentservice/demo.proto
/src/recommendationservice/demo_pb2*.py
/src/shippingservice/proto/
/src/productcatalogservice/genproto
/src/currencyservice/proto
/src/checkoutservice/genproto
/src/accountingservice/genproto
3 changes: 2 additions & 1 deletion docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ services:
image: ${IMAGE_NAME}:${DEMO_VERSION}-currencyservice
container_name: currency-service
build:
context: ./src/currencyservice
context: ./
dockerfile: ./src/currencyservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-currencyservice
deploy:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ services:
image: ${IMAGE_NAME}:${DEMO_VERSION}-currencyservice
container_name: currency-service
build:
context: ./src/currencyservice
context: ./
dockerfile: ./src/currencyservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-currencyservice
deploy:
Expand Down
7 changes: 7 additions & 0 deletions src/accountingservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@


FROM golang:1.22.0-alpine AS builder
RUN apk update && apk add --no-cache make protobuf-dev
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

WORKDIR /usr/src/app/

COPY ./src/accountingservice/ ./
COPY ./pb/ ./pb

RUN protoc -I ./pb ./pb/demo.proto --go_out=./ --go-grpc_out=./
RUN go build -o /go/bin/accountingservice/

# -----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 0c80094

Please sign in to comment.