1FROM python:3.9-slim-bookworm 2 3RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl 4 5WORKDIR /workdir 6 7RUN ln -s /usr/bin/python3 /usr/bin/python 8RUN mkdir /artifacts 9 10COPY . . 11RUN tools/bazel build -c dbg //src/python/grpcio_tests/tests_py3_only/interop:xds_interop_client 12RUN cp -rL /workdir/bazel-bin/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client* /artifacts/ 13 14ENV TINI_VERSION v0.19.0 15ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini 16RUN chmod +x /tini 17 18FROM python:3.9-slim-bookworm 19 20ENV GRPC_VERBOSITY="DEBUG" 21ENV GRPC_TRACE="xds_client,xds_resolver,xds_cluster_manager_lb,cds_lb,xds_cluster_resolver_lb,priority_lb,xds_cluster_impl_lb,weighted_target_lb,ring_hash_lb,outlier_detection_lb" 22 23RUN apt-get update -y \ 24 && apt-get install -y python3 \ 25 && apt-get -y autoremove \ 26 && rm -rf /var/lib/apt/lists/* 27 28RUN ln -s /usr/bin/python3 /usr/bin/python 29 30COPY --from=0 /artifacts ./ 31 32# tini serves as PID 1 and enables the server to properly respond to signals. 33COPY --from=0 /tini /tini 34 35ENTRYPOINT ["/tini", "-g", "-vv", "--", "/xds_interop_client"] 36