Skip to content

Commit b677ac7

Browse files
committed
Verify zip of protoc in generator.Dockerfile
1 parent 7330cbb commit b677ac7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

generator.Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ WORKDIR /src
1414

1515
ENV EBPF_VER=v0.19.0
1616
ENV PROTOC_VERSION=32.0
17+
ENV PROTOC_X86_64_SHA256="7ca037bfe5e5cabd4255ccd21dd265f79eb82d3c010117994f5dc81d2140ee88"
18+
ENV PROTOC_AARCH_64_SHA256="56af3fc2e43a0230802e6fadb621d890ba506c5c17a1ae1070f685fe79ba12d0"
19+
1720
ARG TARGETARCH
1821

1922
RUN apk add clang llvm20 wget unzip curl wget
@@ -23,11 +26,14 @@ RUN apk cache purge
2326
# Deal with the arm64==aarch64 ambiguity
2427
RUN if [ "$TARGETARCH" = "arm64" ]; then \
2528
curl -qL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-aarch_64.zip -o protoc.zip; \
29+
echo "${PROTOC_AARCH_64_SHA256} protoc.zip" > protoc.zip.sha256 ; \
2630
else \
2731
curl -qL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip -o protoc.zip; \
28-
fi
29-
RUN unzip protoc.zip -d /usr/local
30-
RUN rm protoc.zip
32+
echo "${PROTOC_X86_64_SHA256} protoc.zip" > protoc.zip.sha256 ; \
33+
fi; \
34+
sha256sum -c protoc.zip.sha256 \
35+
&& unzip protoc.zip -d /usr/local \
36+
&& rm protoc.zip
3137

3238
# Install protoc-gen-go and protoc-gen-go-grpc
3339
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

0 commit comments

Comments
 (0)