2022-03-29 10:55:34 -07:00
|
|
|
## To test locally:
|
|
|
|
# docker build --pull --rm -f "contrib/devtools/Dockerfile" -t cosmossdk-proto:latest "contrib/devtools"
|
2022-04-22 07:11:30 -07:00
|
|
|
# docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh
|
2022-03-29 10:55:34 -07:00
|
|
|
|
2022-03-21 04:23:46 -07:00
|
|
|
FROM bufbuild/buf:1.1.0 as BUILDER
|
2021-01-18 07:41:34 -08:00
|
|
|
|
2022-04-20 11:33:56 -07:00
|
|
|
FROM golang:1.18-alpine
|
2021-01-18 07:41:34 -08:00
|
|
|
|
2022-03-25 05:35:09 -07:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
nodejs \
|
|
|
|
npm \
|
|
|
|
git \
|
|
|
|
make
|
2021-01-18 07:41:34 -08:00
|
|
|
|
2022-03-25 05:35:09 -07:00
|
|
|
ENV GOLANG_PROTOBUF_VERSION=1.28.0 \
|
2022-03-26 15:38:32 -07:00
|
|
|
GOGO_PROTOBUF_VERSION=1.3.2 \
|
2022-03-25 05:35:09 -07:00
|
|
|
GRPC_GATEWAY_VERSION=1.16.0
|
2021-01-18 07:41:34 -08:00
|
|
|
|
2022-03-26 15:38:32 -07:00
|
|
|
|
2022-04-22 07:11:30 -07:00
|
|
|
RUN go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest
|
|
|
|
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION}
|
|
|
|
RUN go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} \
|
|
|
|
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v${GRPC_GATEWAY_VERSION}
|
2021-01-18 07:41:34 -08:00
|
|
|
|
2022-04-22 07:11:30 -07:00
|
|
|
# install all gogo protobuf binaries
|
|
|
|
RUN git clone https://github.com/regen-network/protobuf.git; \
|
|
|
|
cd protobuf; \
|
|
|
|
go mod download; \
|
|
|
|
make install
|
|
|
|
|
|
|
|
# we need to use git clone because we use 'replace' directive in go.mod
|
|
|
|
# protoc-gen-gocosmos was moved to to in cosmos/gogoproto but pending a migration there.
|
|
|
|
RUN git clone https://github.com/regen-network/cosmos-proto.git; \
|
|
|
|
cd cosmos-proto/protoc-gen-gocosmos; \
|
|
|
|
go install .
|
2021-04-07 03:31:39 -07:00
|
|
|
|
|
|
|
RUN npm install -g swagger-combine
|
|
|
|
|
2021-01-18 07:41:34 -08:00
|
|
|
COPY --from=BUILDER /usr/local/bin /usr/local/bin
|