From 7c7c95e58aae0d39cde536e8b90bc38b248839ba Mon Sep 17 00:00:00 2001 From: ardevd Date: Wed, 29 Mar 2023 21:45:51 +0200 Subject: [PATCH] lnrpc: fully dockerize protobuf generation Remove the need for golang on the host by utilizing golang docker containers to obtain protobuf and grpc gateway versions. --- lnrpc/gen_protos_docker.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lnrpc/gen_protos_docker.sh b/lnrpc/gen_protos_docker.sh index 0e06bb9da..f867158f3 100755 --- a/lnrpc/gen_protos_docker.sh +++ b/lnrpc/gen_protos_docker.sh @@ -5,8 +5,13 @@ set -e # Directory of the script file, independent of where it's called from. DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" -PROTOBUF_VERSION=$(go list -f '{{.Version}}' -m google.golang.org/protobuf) -GRPC_GATEWAY_VERSION=$(go list -f '{{.Version}}' -m github.com/grpc-ecosystem/grpc-gateway/v2) +# golang docker image version used in this script. +GO_IMAGE=golang:1.19.7-alpine + +PROTOBUF_VERSION=$(docker run --rm -v $DIR/../:/lnd -w /lnd $GO_IMAGE \ + go list -f '{{.Version}}' -m google.golang.org/protobuf) +GRPC_GATEWAY_VERSION=$(docker run --rm -v $DIR/../:/lnd -w /lnd $GO_IMAGE \ + go list -f '{{.Version}}' -m github.com/grpc-ecosystem/grpc-gateway/v2) echo "Building protobuf compiler docker image..." docker build -t lnd-protobuf-builder \