-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (32 loc) · 1.41 KB
/
Dockerfile
File metadata and controls
40 lines (32 loc) · 1.41 KB
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
# If you change this value, please change it in the following files as well:
# /.github/workflows/main.yaml
# /Dockerfile
# /dev.Dockerfile
# /make/builder.Dockerfile
# /tools/Dockerfile
FROM golang:1.23-bookworm
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
git=1:2.39.5-0+deb12u3 \
protobuf-compiler=3.21.12-3 \
clang-format=1:14.0-55.7~deb12u1 \
&& rm -rf /var/lib/apt/lists/*
# 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 PROTOBUF_VERSION
ARG GRPC_GATEWAY_VERSION
ENV PROTOC_GEN_GO_GRPC_VERSION="v1.1.0"
ENV GOCACHE=/tmp/build/.cache
ENV GOMODCACHE=/tmp/build/.modcache
WORKDIR /tmp
RUN mkdir -p /tmp/build/.cache \
&& mkdir -p /tmp/build/.modcache \
&& go install "google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOBUF_VERSION}" \
&& go install "google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION}" \
&& go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${GRPC_GATEWAY_VERSION}" \
&& go install "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${GRPC_GATEWAY_VERSION}" \
&& go install golang.org/x/tools/cmd/goimports@v0.1.7 \
&& chmod -R 777 /tmp/build/
WORKDIR /build
CMD ["/bin/bash", "/build/proto/protocgen.sh"]