From 25ce1ed6213004578e9ac189ae7390410b7943e5 Mon Sep 17 00:00:00 2001 From: yito88 Date: Thu, 12 Sep 2024 12:48:05 +0200 Subject: [PATCH] install protoc for docker build --- ci/release/hermes.Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ci/release/hermes.Dockerfile b/ci/release/hermes.Dockerfile index 8540b2446b..e09470420a 100644 --- a/ci/release/hermes.Dockerfile +++ b/ci/release/hermes.Dockerfile @@ -6,10 +6,24 @@ FROM rust:1-buster AS build-env ARG TAG +ARG PROTOC_VERSION=28.1 WORKDIR /root COPY . . + +# Install protoc +RUN ARCH=$(uname -m) && OS=$(uname -s) && \ + if [ "$OS" = "Linux" ] && [ "$ARCH" = "x86_64" ]; then \ + PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip; \ + elif [ "$OS" = "Linux" ] && [ "$ARCH" = "aarch64" ]; then \ + PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-aarch_64.zip; \ + else \ + echo "Unsupported OS/architecture: $OS-$ARCH"; exit 1; \ + fi && \ + wget https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP -O /tmp/protoc.zip && \ + unzip /tmp/protoc.zip -d /usr/local && \ + rm -rf /tmp/protoc.zip RUN cargo build --release FROM ubuntu:latest