2021-02-17 03:18:35 +03:00
|
|
|
FROM golang:1.16.3-buster
|
2021-01-15 15:44:50 +03:00
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
git \
|
|
|
|
protobuf-compiler='3.6.1*' \
|
|
|
|
clang-format='1:7.0*'
|
|
|
|
|
|
|
|
# We don't want any default values for these variables to make sure they're
|
|
|
|
# explicitly provided by parsing the go.mod file. Otherwise we might forget to
|
|
|
|
# update them here if we bump the versions.
|
|
|
|
ARG PROTOC_GEN_VERSION
|
|
|
|
ARG GRPC_GATEWAY_VERSION
|
|
|
|
|
2020-08-28 12:18:15 +03:00
|
|
|
ENV FALAFEL_VERSION="v0.9.0"
|
2021-01-15 15:44:54 +03:00
|
|
|
ENV GOCACHE=/tmp/build/.cache
|
|
|
|
ENV GOMODCACHE=/tmp/build/.modcache
|
|
|
|
|
2021-01-15 15:44:50 +03:00
|
|
|
RUN cd /tmp \
|
2021-01-15 15:44:54 +03:00
|
|
|
&& mkdir -p /tmp/build/.cache \
|
|
|
|
&& mkdir -p /tmp/build/.modcache \
|
2021-01-15 15:44:50 +03:00
|
|
|
&& export GO111MODULE=on \
|
|
|
|
&& go get github.com/golang/protobuf/protoc-gen-go@${PROTOC_GEN_VERSION} \
|
|
|
|
&& go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@${GRPC_GATEWAY_VERSION} \
|
2021-01-15 15:44:54 +03:00
|
|
|
&& go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@${GRPC_GATEWAY_VERSION} \
|
|
|
|
&& go get github.com/lightninglabs/falafel@${FALAFEL_VERSION} \
|
|
|
|
&& go get golang.org/x/tools/cmd/goimports \
|
|
|
|
&& chmod -R 777 /tmp/build/
|
2021-01-15 15:44:50 +03:00
|
|
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
CMD ["/bin/bash", "/build/lnrpc/gen_protos.sh"]
|