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 16# 17# Stage 1: Build the interop test client and server 18# 19 20FROM debian:bullseye as build 21 22RUN apt-get update && apt-get install -y clang curl git 23 24WORKDIR /grpc 25COPY . . 26 27RUN /grpc/tools/bazel build test/cpp/interop:observability_interop_test 28 29 30 31# 32# Stage 2: 33# 34# - Copy only the necessary files to reduce Docker image size. 35# - Have an ENTRYPOINT script which will launch the interop test client or server 36# with the given parameters. 37# 38 39FROM debian:bullseye 40 41ENV GRPC_TRACE environment_autodetect 42ENV GRPC_VERBOSITY debug 43 44 45WORKDIR /usr/share/grpc 46COPY --from=build /grpc/etc/roots.pem . 47 48 49WORKDIR /grpc/bazel-bin/test/cpp/interop 50COPY --from=build /grpc/bazel-bin/test/cpp/interop/observability_interop_server . 51COPY --from=build /grpc/bazel-bin/test/cpp/interop/observability_interop_client . 52 53WORKDIR /grpc/tools/dockerfile/observability-test/cpp 54COPY --from=build /grpc/tools/dockerfile/observability-test/cpp/run.sh . 55 56ENTRYPOINT ["/grpc/tools/dockerfile/observability-test/cpp/run.sh"] 57