在Alpine Linux上构建gRPC命令行工具


介绍

我想将grpc_cli放在高山中用于调试目的,但是我很难。我花了一段时间找到我需要的包裹,因此记下它。

对于grpc_cli的安装文件,我在这里提到了官方。

https://github.com/grpc/grpc/blob/1f670397ce7f8a12dfb1fb32d8857b2233022856/doc/command_line_tool.md

建造

登录到高山

1
2
3
docker pull alpine:3.13.0
docker run --name alpine-test -itd alpine:3.13.0 /bin/ash
docker exec -it alpine-test /bin/ash

克隆grpc并构建grpc_cli

1
2
3
4
5
6
7
8
apk add --update git cmake make clang build-base llvm-static llvm-dev clang-static clang-dev linux-headers
git clone https://github.com/grpc/grpc
cd grpc
git submodule update --init
mkdir -p cmake/build
cd cmake/build
cmake -DgRPC_BUILD_TESTS=ON ../..
make grpc_cli

运行

1
2
3
4
5
6
7
8
9
10
11
12
./grpc_cli --helpfull
grpc_cli: Warning: SetProgramUsageMessage() never called

  Flags from root/grpc/test/cpp/util/cli_credentials.cc:
    --call_creds (Call credentials to use: none (default), or
      access_token=<token>. If provided, the call creds are composited on top of
      channel creds.); default: "";
    --channel_creds_type (The channel creds type: insecure, ssl, gdc (Google
      Default Credentials), alts, or local.); default: "";
    --local_connect_type (The type of local connections for which local channel
      credentials will be applied. Should be local_tcp or uds.);
...

综上所述

我什至没有搜索有关如何进入高山的诀窍。谷歌功率低吗? ..