-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocker.buf
40 lines (30 loc) · 1.41 KB
/
Docker.buf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM ubuntu:20.04
ARG BUF_VERSION="1.0.0-rc12"
ARG PROTOC_VERSION="3.19.4"
ARG GO_VERSION="1.17.6"
ARG NODE_VERSION="16"
ENV DEBIAN_FRONTEND=noninteractive
# Update APT
RUN apt-get update
# Install dependencies
RUN apt-get install -y curl wget unzip git gcc g++ make cmake
# Install Buf
RUN curl -sSL "https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-$(uname -s)-$(uname -m)" -o "/usr/local/bin/buf" && chmod +x "/usr/local/bin/buf"
# Install Go
RUN wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz
RUN rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz
ENV PATH=$PATH:/usr/local/go/bin:/root/go/bin
# Install Protoc binary
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip
RUN unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local/protoc
ENV PATH=$PATH:/usr/local/protoc/bin
# Install plugins
RUN go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
RUN go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
RUN go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest
# Setup workspace as working folder
WORKDIR /workspace
# Run buf as entrypoint
ENTRYPOINT [ "buf" ]