mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-16 23:17:42 +00:00
In order to have a reproducible code generation process, we need to pin the versions of the tools used. This is accomplished easiest by generating inside a container. This commit adds a container image definition with fixed dependencies for Golang proto/ttrpc code generation, and changes the agent Makefile to invoke the update-generated-proto.sh script from within that container. Signed-off-by: Markus Rudy <mr@edgeless.systems>
24 lines
724 B
Docker
24 lines
724 B
Docker
# Copyright (c) 2025 Edgeless Systems gmbH
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
ARG GO_VERSION=
|
|
|
|
FROM busybox:1.37.0 AS resources
|
|
|
|
WORKDIR /usr/local
|
|
|
|
ARG PROTOC_VERSION=
|
|
RUN wget -O /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && \
|
|
unzip /tmp/protoc.zip
|
|
|
|
FROM golang:${GO_VERSION}
|
|
|
|
COPY --from=resources /usr/local /usr
|
|
|
|
ARG PROTOC_GEN_GO_VERSION=
|
|
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION}
|
|
ARG TTRPC_VERSION=
|
|
RUN go install github.com/containerd/ttrpc/cmd/protoc-gen-go-ttrpc@${TTRPC_VERSION}
|
|
RUN go install github.com/containerd/ttrpc/cmd/protoc-gen-gogottrpc@${TTRPC_VERSION}
|