Skip to content

Commit

Permalink
Update dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
stanley-cheung committed Oct 16, 2019
1 parent ab6ff71 commit bc33941
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 65 deletions.
18 changes: 9 additions & 9 deletions net/grpc/gateway/docker/binary_client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@

FROM grpcweb/prereqs

ARG EXAMPLE_DIR=/github/grpc-web/net/grpc/gateway/examples/echo
WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo

RUN protoc -I=$EXAMPLE_DIR echo.proto \
--js_out=import_style=commonjs:\
$EXAMPLE_DIR/commonjs-example \
--grpc-web_out=import_style=commonjs,mode=grpcweb:\
$EXAMPLE_DIR/commonjs-example
RUN protoc -I=. echo.proto \
--js_out=import_style=commonjs:./commonjs-example \
--grpc-web_out=import_style=commonjs,mode=grpcweb:./commonjs-example

RUN cd $EXAMPLE_DIR/commonjs-example && \
npm install && \
WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo/commonjs-example

RUN npm install && \
npm link grpc-web && \
npx webpack && \
cp echotest.html /var/www/html && \
cp dist/main.js /var/www/html/dist

EXPOSE 8081
WORKDIR /var/www/html

EXPOSE 8081
CMD ["python", "-m", "SimpleHTTPServer", "8081"]
19 changes: 9 additions & 10 deletions net/grpc/gateway/docker/closure_client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@ FROM grpcweb/prereqs
RUN apt-get -qq update && apt-get -qq install -y \
default-jdk

RUN cd /github/grpc-web && \
curl -sS https://dl.google.com/closure-compiler/compiler-20190909.zip \
-o /github/grpc-web/compiler-latest.zip
WORKDIR /github/grpc-web

RUN cd /github/grpc-web && \
rm -f /github/grpc-web/closure-compiler.jar && \
unzip -p -qq -o /github/grpc-web/compiler-latest.zip *.jar > \
/github/grpc-web/closure-compiler.jar
RUN curl -sS https://dl.google.com/closure-compiler/compiler-20190909.zip \
-o compiler-latest.zip

RUN cd /github/grpc-web && \
make client && make install-example
RUN rm -f closure-compiler.jar && \
unzip -p -qq -o compiler-latest.zip *.jar > closure-compiler.jar

RUN make client && make install-example

EXPOSE 8081
WORKDIR /var/www/html

EXPOSE 8081
CMD ["python", "-m", "SimpleHTTPServer", "8081"]
13 changes: 8 additions & 5 deletions net/grpc/gateway/docker/common/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ FROM node:10-stretch
RUN apt-get -qq update && apt-get -qq install -y \
unzip

RUN git clone https://github.com/grpc/grpc-web /github/grpc-web
WORKDIR /tmp

RUN curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v3.8.0/\
protoc-3.8.0-linux-x86_64.zip -o /tmp/protoc.zip && \
cd /tmp && \
protoc-3.8.0-linux-x86_64.zip -o protoc.zip && \
unzip -qq protoc.zip && \
cp /tmp/bin/protoc /usr/local/bin/protoc
cp ./bin/protoc /usr/local/bin/protoc

RUN curl -sSL https://github.com/grpc/grpc-web/releases/download/1.0.6/\
protoc-gen-grpc-web-1.0.6-linux-x86_64 -o /usr/local/bin/protoc-gen-grpc-web && \
chmod +x /usr/local/bin/protoc-gen-grpc-web

RUN mkdir -p /var/www/html/dist
WORKDIR /var/www/html/dist

WORKDIR /github/grpc-web

RUN git clone https://github.com/grpc/grpc-web .
18 changes: 9 additions & 9 deletions net/grpc/gateway/docker/commonjs_client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@

FROM grpcweb/common

ARG EXAMPLE_DIR=/github/grpc-web/net/grpc/gateway/examples/echo
WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo

RUN protoc -I=$EXAMPLE_DIR echo.proto \
--js_out=import_style=commonjs:\
$EXAMPLE_DIR/commonjs-example \
--grpc-web_out=import_style=commonjs,mode=grpcwebtext:\
$EXAMPLE_DIR/commonjs-example
RUN protoc -I=. echo.proto \
--js_out=import_style=commonjs:./commonjs-example \
--grpc-web_out=import_style=commonjs,mode=grpcwebtext:./commonjs-example

RUN cd $EXAMPLE_DIR/commonjs-example && \
npm install && \
WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo/commonjs-example

RUN npm install && \
npx webpack && \
cp echotest.html /var/www/html && \
cp dist/main.js /var/www/html/dist

EXPOSE 8081
WORKDIR /var/www/html

EXPOSE 8081
CMD ["python", "-m", "SimpleHTTPServer", "8081"]
9 changes: 6 additions & 3 deletions net/grpc/gateway/docker/echo_server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@

FROM grpcweb/prereqs

RUN cd /github/grpc-web && \
make echo_server
WORKDIR /github/grpc-web

RUN make echo_server

WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo

EXPOSE 9090
CMD ["/github/grpc-web/net/grpc/gateway/examples/echo/echo_server"]
CMD ["./echo_server"]
9 changes: 5 additions & 4 deletions net/grpc/gateway/docker/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ FROM grpcweb/prereqs
RUN apt-get -qq install -y \
zip

RUN cd /github/grpc-web/net/grpc/gateway/examples/echo && \
WORKDIR /github/grpc-web

RUN cd ./net/grpc/gateway/examples/echo && \
sed -i 's/localhost:9090/echo-server:9090/g' nginx.conf

RUN cd /github/grpc-web && \
make standalone-proxy
RUN make standalone-proxy

EXPOSE 8080
CMD ["/github/grpc-web/gConnector_static/nginx.sh"]
CMD ["./gConnector_static/nginx.sh"]
7 changes: 4 additions & 3 deletions net/grpc/gateway/docker/node_server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

FROM grpcweb/common

RUN cd /github/grpc-web/net/grpc/gateway/examples/echo/node-server && \
npm install
WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo/node-server

RUN npm install

EXPOSE 9090
CMD ["node", "/github/grpc-web/net/grpc/gateway/examples/echo/node-server/server.js"]
CMD ["node", "server.js"]
16 changes: 8 additions & 8 deletions net/grpc/gateway/docker/prereqs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ FROM grpcweb/common

ARG MAKEFLAGS=-j8

COPY . /github/grpc-web
WORKDIR /github/grpc-web

RUN cd /github/grpc-web && \
git checkout . && \
COPY . .

RUN git checkout . && \
git clean -f -d -x && \
rm -rf third_party && \
git checkout third_party && \
./scripts/init_submodules.sh

RUN cd /github/grpc-web/packages/grpc-web && \
RUN cd ./packages/grpc-web && \
npm install && \
npm run build && \
npm link

RUN cd /github/grpc-web/third_party/grpc && \
RUN cd ./third_party/grpc && \
make install

RUN cd /github/grpc-web/third_party/grpc/third_party/protobuf && \
RUN cd ./third_party/grpc/third_party/protobuf && \
make install

RUN cd /github/grpc-web && \
make install-plugin
RUN make install-plugin
13 changes: 7 additions & 6 deletions net/grpc/gateway/docker/protoc_plugin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ RUN apt-get -qq update && apt-get -qq install -y \
software-properties-common \
zip

RUN git clone https://github.com/grpc/grpc-web /github/grpc-web
WORKDIR /github/grpc-web

COPY ./javascript /github/grpc-web/javascript
RUN git clone https://github.com/grpc/grpc-web .

RUN cd /github/grpc-web && \
./scripts/init_submodules.sh
COPY ./javascript ./javascript

RUN cd /github/grpc-web/third_party/grpc/third_party/protobuf && \
RUN ./scripts/init_submodules.sh

RUN cd ./third_party/grpc/third_party/protobuf && \
./autogen.sh && ./configure && make && make install

RUN cd /github/grpc-web/javascript/net/grpc/web && \
RUN cd ./javascript/net/grpc/web && \
make protoc-gen-grpc-web
18 changes: 10 additions & 8 deletions net/grpc/gateway/docker/ts_client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,24 @@

FROM grpcweb/prereqs

ARG EXAMPLE_DIR=/github/grpc-web/net/grpc/gateway/examples/echo

RUN npm install -g tsc typescript

RUN protoc -I=$EXAMPLE_DIR echo.proto \
--js_out=import_style=commonjs:$EXAMPLE_DIR/ts-example \
--grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:$EXAMPLE_DIR/ts-example
WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo

RUN protoc -I=. echo.proto \
--js_out=import_style=commonjs:./ts-example \
--grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:./ts-example

WORKDIR /github/grpc-web/net/grpc/gateway/examples/echo/ts-example

RUN cd $EXAMPLE_DIR/ts-example && \
npm install && \
RUN npm install && \
npm link grpc-web && \
tsc && \
npx webpack && \
cp echotest.html /var/www/html && \
cp dist/main.js /var/www/html/dist

EXPOSE 8081
WORKDIR /var/www/html

EXPOSE 8081
CMD ["python", "-m", "SimpleHTTPServer", "8081"]

0 comments on commit bc33941

Please sign in to comment.