Skip to content

Commit

Permalink
Dockerfile: Update protobuf-compiler to 21.7
Browse files Browse the repository at this point in the history
This commit reworks the protobuf-compiler (protoc) installation step to
use the precompiled binaries instead of the distro package and updates
its version to 21.7 because the latest Python protobuf package requires
a more up-to-date version than what is provided by the distro.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
  • Loading branch information
stephanosio committed Oct 5, 2022
1 parent a72fd71 commit 1a0e373
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ARG RENODE_VERSION=1.13.2
ARG LLVM_VERSION=15
ARG BSIM_VERSION=v1.0.3
ARG SPARSE_VERSION=9212270048c3bd23f56c20a83d4f89b870b2b26e
ARG PROTOC_VERSION=21.7
ARG WGET_ARGS="-q --show-progress --progress=bar:force:noscroll --no-check-certificate"

ARG UID=1000
Expand Down Expand Up @@ -68,7 +69,6 @@ RUN apt-get -y update && \
ninja-build \
openssh-client \
pkg-config \
protobuf-compiler \
python3-dev \
python3-pip \
python3-ply \
Expand Down Expand Up @@ -181,6 +181,15 @@ RUN mkdir -p /opt/sparse && \
PREFIX=/opt/sparse make install && \
rm -rf /opt/sparse/sparse

# Install protobuf-compiler
RUN mkdir -p /opt/protoc && \
cd /opt/protoc && \
PROTOC_HOSTTYPE=$(case $HOSTTYPE in x86_64) echo "x86_64";; aarch64) echo "aarch_64";; esac) && \
wget ${WGET_ARGS} https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${PROTOC_HOSTTYPE}.zip && \
unzip protoc-${PROTOC_VERSION}-linux-${PROTOC_HOSTTYPE}.zip && \
ln -s /opt/protoc/bin/protoc /usr/local/bin && \
rm -f protoc-${PROTOC_VERSION}-linux-${PROTOC_HOSTTYPE}.zip

# Install Zephyr SDK
RUN mkdir -p /opt/toolchains && \
cd /opt/toolchains && \
Expand Down

0 comments on commit 1a0e373

Please sign in to comment.