Skip to content

Commit 5a9d9ea

Browse files
YusukeShimizucdecker
authored andcommitted
gltesting: use correct protoc for each arch
Enable multi-architecture support to ensure proper protoc downloads based on the build environment. This fixes issues on Apple Silicon (ARM64) where the x86_64 binary was previously being downloaded, leading to the missing ld-linux-x86-64.so.2 error. * Use the same protocol buffer compiler version across architectures * Ensure Docker build success on Apple Silicon
1 parent face259 commit 5a9d9ea

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docker/gl-testing/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,18 @@ RUN wget -q https://github.com/cloudflare/cfssl/releases/download/v1.5.0/cfssljs
109109
# STAGE: protoc-downloader
110110
# ----------------------------------------
111111
FROM ubuntu:22.04 AS protoc-downloader
112+
ARG TARGETPLATFORM
113+
112114
RUN apt update && apt install -qqy wget unzip
113-
RUN mkdir /tmp/protoc && \
115+
RUN PLATFORM=$( \
116+
case ${TARGETPLATFORM} in \
117+
linux/amd64 ) echo "x86_64";; \
118+
linux/arm64 ) echo "aarch_64";; \
119+
esac \
120+
) && \
121+
mkdir /tmp/protoc && \
114122
cd /tmp/protoc && \
115-
wget --quiet -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.3/protoc-3.19.3-linux-x86_64.zip && \
123+
wget --quiet -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.19.3/protoc-3.19.3-linux-${PLATFORM}.zip && \
116124
unzip protoc.zip && \
117125
mv /tmp/protoc/bin/protoc /usr/local/bin && \
118126
chmod a+x /usr/local/bin/protoc && \

0 commit comments

Comments
 (0)