|
| 1 | +# Copyright 2022 gRPC authors. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# Dockerfile for building the xDS interop client. To build the image, run the |
| 16 | +# following command from grpc-node directory: |
| 17 | +# docker build -t <TAG> -f packages/grpc-js-xds/interop/test-server.Dockerfile . |
| 18 | + |
| 19 | +FROM node:18-slim as build |
| 20 | + |
| 21 | +# Make a grpc-node directory and copy the repo into it. |
| 22 | +WORKDIR /node/src/grpc-node |
| 23 | +COPY . . |
| 24 | + |
| 25 | +WORKDIR /node/src/grpc-node/packages/proto-loader |
| 26 | +RUN npm install |
| 27 | +WORKDIR /node/src/grpc-node/packages/grpc-js |
| 28 | +RUN npm install |
| 29 | +WORKDIR /node/src/grpc-node/packages/grpc-health-check |
| 30 | +RUN npm install |
| 31 | +WORKDIR /node/src/grpc-node/packages/grpc-reflection |
| 32 | +RUN npm install |
| 33 | +WORKDIR /node/src/grpc-node/packages/grpc-js-xds |
| 34 | +RUN npm install |
| 35 | + |
| 36 | +ENV TINI_VERSION v0.19.0 |
| 37 | +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini |
| 38 | +RUN chmod +x /tini |
| 39 | + |
| 40 | +FROM gcr.io/distroless/nodejs18-debian11:latest |
| 41 | +WORKDIR /node/src/grpc-node |
| 42 | +COPY --from=build /node/src/grpc-node/packages/proto-loader ./packages/proto-loader/ |
| 43 | +COPY --from=build /node/src/grpc-node/packages/grpc-health-check ./packages/grpc-health-check/ |
| 44 | +COPY --from=build /node/src/grpc-node/packages/grpc-reflection ./packages/grpc-reflection/ |
| 45 | +COPY --from=build /node/src/grpc-node/packages/grpc-js ./packages/grpc-js/ |
| 46 | +COPY --from=build /node/src/grpc-node/packages/grpc-js-xds ./packages/grpc-js-xds/ |
| 47 | + |
| 48 | +ENV GRPC_VERBOSITY="DEBUG" |
| 49 | +ENV GRPC_TRACE=xds_client,server,xds_server |
| 50 | + |
| 51 | +# tini serves as PID 1 and enables the server to properly respond to signals. |
| 52 | +COPY --from=build /tini /tini |
| 53 | + |
| 54 | +ENTRYPOINT [ "/tini", "-g", "-vv", "--", "/nodejs/bin/node", "/node/src/grpc-node/packages/grpc-js-xds/build/interop/xds-interop-server" ] |
0 commit comments