はじめに
デバッグ目的でgrpc_cliをalpineに入れたくてやったらわりと手こずりました。必要なパッケージ見つけるのにけっこう時間がかかったのでメモっておきます。
grpc_cliのセットアップドキュメントは公式のこちらを参考にしました。
ビルドする
alpineにログインする
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をビルドする
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
実行する
./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.);
...
おわりに
alpineに入ってどうこうするってノウハウわりと探してもないものですね。ググり力が低いのか。。