-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
47 lines (32 loc) · 997 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM ubuntu:20.04 AS builder
ARG MAKEFLAGS=-j8
RUN apt-get update && apt-get install -y \
automake \
build-essential \
git \
libtool \
make
RUN git clone https://github.com/grpc/grpc-web /github/grpc-web
WORKDIR /github/grpc-web
RUN git checkout tags/1.2.1
## Install gRPC and protobuf
RUN ./scripts/init_submodules.sh
RUN cd third_party/grpc && make && make install
RUN cd third_party/grpc/third_party/protobuf && make install
## Install all the gRPC-web plugin
RUN make install-plugin
FROM ubuntu:20.04
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /usr/local/include /usr/local/include
## Create the gRPC client
ENV import_style=commonjs
ENV grpc_web_import_style=commonjs
ENV mode=grpcwebtext
VOLUME /protofile
ENV protofile=echo.proto
ENV output=/protofile/generated
CMD protoc \
-I=/protofile \
/protofile/$protofile \
--js_out=import_style=$import_style:$output \
--grpc-web_out=import_style=$grpc_web_import_style,mode=$mode:$output