File tree Expand file tree Collapse file tree 2 files changed +13
-18
lines changed
Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 1- FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS builder
1+ FROM golang:1.26-alpine AS builder
22
3- ARG TARGETOS
4- ARG TARGETARCH
5- ARG TARGETVARIANT
3+ ARG TARGETPLATFORM
64
75ENV CGO_ENABLED=0
86
97WORKDIR /src
8+ # https://buf.build/docs/bsr/remote-plugins/custom-plugins/#build-a-docker-image
9+ RUN test "${TARGETPLATFORM}" = "linux/amd64" || (echo "buf plugin image must be built for linux/amd64" && exit 1)
10+
1011COPY protoc_plugins/go.mod protoc_plugins/go.sum ./
1112RUN go mod download
1213
1314COPY protoc_plugins/ .
1415
15- RUN set -eux; \
16- goarm="" ; \
17- goamd64="" ; \
18- if [ "${TARGETARCH:-}" = "arm" ] && [ -n "${TARGETVARIANT:-}" ]; then goarm="${TARGETVARIANT#v}" ; fi; \
19- if [ "${TARGETARCH:-}" = "amd64" ] && [ -n "${TARGETVARIANT:-}" ]; then goamd64="${TARGETVARIANT#v}" ; fi; \
20- GOOS="${TARGETOS:-linux}" GOARCH="${TARGETARCH:-amd64}" GOARM="${goarm}" GOAMD64="${goamd64}" \
21- go build -trimpath -ldflags "-s -w" -o /out/protoc-gen-php-grpc-plugin ./protoc-gen-php-grpc
16+ RUN go build -trimpath -ldflags "-s -w" -o /out/protoc-gen-php-grpc-plugin ./protoc-gen-php-grpc
2217
2318FROM scratch
2419
Original file line number Diff line number Diff line change @@ -48,15 +48,15 @@ func (p *Plugin) createGRPCserver(interceptors map[string]api.Interceptor) (*grp
4848 interceptors [name ].UnaryServerInterceptor (),
4949 )
5050 }
51-
52- opts = append (
53- opts ,
54- grpc .ChainUnaryInterceptor (
55- unaryInterceptors ... ,
56- ),
57- )
5851 }
5952
53+ opts = append (
54+ opts ,
55+ grpc .ChainUnaryInterceptor (
56+ unaryInterceptors ... ,
57+ ),
58+ )
59+
6060 opts = append (opts , grpc .StatsHandler (otelgrpc .NewServerHandler (otelgrpc .WithTracerProvider (p .tracer ), otelgrpc .WithPropagators (p .prop ))))
6161 server := grpc .NewServer (opts ... )
6262
You can’t perform that action at this time.
0 commit comments