Skip to content

Commit 71f8ad0

Browse files
committed
Support both x86_64 and arm
1 parent bbd1e39 commit 71f8ad0

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

codegen.Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ FROM python:3.9
1515
# Set working directory
1616
WORKDIR /workspace
1717

18-
ENV PROTOC_ZIP=protoc-29.3-linux-aarch_64.zip
19-
20-
RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v29.3/$PROTOC_ZIP
21-
RUN unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
18+
ENV PROTOC_VERSION=29.3
19+
RUN ARCH=$(uname -m) && \
20+
case "$ARCH" in \
21+
x86_64) PROTOC_ARCH="x86_64" ;; \
22+
arm64|aarch64) PROTOC_ARCH="aarch_64" ;; \
23+
*) echo "Unsupported architecture: $ARCH" && exit 1 ;; \
24+
esac && \
25+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip && \
26+
unzip -o protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip -d /usr/local && \
27+
rm protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip
2228

2329
# Copy installed Go deps from previous build step
2430
COPY --from=0 /go /go

0 commit comments

Comments
 (0)