teleport/build.assets/Dockerfile-grpcbox
Alan Parra 23e8f1d67e
chore: Bump Go to 1.21.1 (#31505)
* Don't attempt to use Go 1.19 in the root module

* Use Go 1.21 on grpcbox

* Bump Go to 1.21.1

* Bump Go toolchain to go1.21.1

* Run `make dronegen`
2023-09-06 17:14:55 +00:00

49 lines
1.5 KiB
Plaintext

FROM docker.io/golang:1.21
# Image layers go from less likely to most likely to change.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
npm \
unzip \
&& \
rm -rf /var/lib/apt/lists/*
# protoc-gen-gogofast
# Keep in sync with api/proto/buf.yaml (and buf.lock)
# eg, "v1.3.2"
ARG GOGO_PROTO_TAG
RUN go install "github.com/gogo/protobuf/protoc-gen-gogofast@$GOGO_PROTO_TAG"
# protoc-gen-js and protoc-gen-ts
# eg, "1.12.4"
ARG NODE_GRPC_TOOLS_VERSION
# eg, "5.0.1"
ARG NODE_PROTOC_TS_VERSION
RUN npm install --global "grpc-tools@$NODE_GRPC_TOOLS_VERSION" "grpc_tools_node_protoc_ts@$NODE_PROTOC_TS_VERSION"
# protoc
# eg, "3.20.2"
ARG PROTOC_VERSION
RUN VERSION="$PROTOC_VERSION" && \
PB_REL='https://github.com/protocolbuffers/protobuf/releases' && \
PB_FILE="$(mktemp protoc-XXXXXX.zip)" && \
ARCH="$(if [ "$(uname -m)" = aarch64 ]; then echo aarch_64; else uname -m; fi)" && \
curl -fsSL -o "$PB_FILE" "$PB_REL/download/v$VERSION/protoc-$VERSION-linux-$ARCH.zip" && \
unzip "$PB_FILE" -d /usr/local && \
rm -f "$PB_FILE"
# buf
# eg, "v1.26.1"
ARG BUF_VERSION
RUN VERSION="$BUF_VERSION"; \
go install "github.com/bufbuild/buf/cmd/buf@$VERSION"
# Pre-install go-runned binaries.
# This is meant to be the only step that changes depending on the Teleport
# branch.
COPY go.mod go.sum /teleport-module/
RUN cd /teleport-module; \
go install github.com/bufbuild/connect-go/cmd/protoc-gen-connect-go && \
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc && \
go install google.golang.org/protobuf/cmd/protoc-gen-go