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.
This commit is contained in:
ardevd 2023-03-29 21:45:51 +02:00
parent 51df3e5b1e
commit 7c7c95e58a

View File

@ -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 \