mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-10 15:07:24 +00:00
This pull request aims to make it possible to generate, format, and lint the protos within this repo. To accomplish that end, the Dockerfile containing common tools for building the tendermint protos has been moved into this repository and several accompanying changes were made to streamline the proto generation process.
26 lines
1.1 KiB
Docker
26 lines
1.1 KiB
Docker
# This Dockerfile defines an image containing tools for linting, formatting,
|
|
# and compiling the Tendermint protos.
|
|
|
|
FROM bufbuild/buf:latest as buf
|
|
|
|
FROM golang:1.17-alpine
|
|
|
|
# Install a commonly used set of programs for use with our protos.
|
|
# clang-extra-tools is included here because it provides clang-format,
|
|
# used to format the .proto files.
|
|
RUN apk add --update --no-cache build-base clang-extra-tools curl git && \
|
|
apk add --update --no-cache build-base clang-extra-tools curl git go && \
|
|
rm -rf /var/cache/apk/*
|
|
|
|
ENV GOLANG_PROTOBUF_VERSION=1.3.1 \
|
|
GOGO_PROTOBUF_VERSION=1.3.2
|
|
|
|
# Retrieve the go protoc programs and copy them into the PATH
|
|
RUN go install github.com/golang/protobuf/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} && \
|
|
go install github.com/gogo/protobuf/protoc-gen-gogo@v${GOGO_PROTOBUF_VERSION} && \
|
|
go install github.com/gogo/protobuf/protoc-gen-gogofaster@v${GOGO_PROTOBUF_VERSION} && \
|
|
mv "$(go env GOPATH)"/bin/* /usr/local/bin/
|
|
|
|
# Copy the 'buf' program out of the buildbuf/buf container.
|
|
COPY --from=buf /usr/local/bin/* /usr/local/bin/
|