Skip to content

Commit a17292d

Browse files
authored
chore(devcontainer): use debian's protobuf-compiler package (apache#16687)
* chore(devcontainer): use debian's `protobuf-compiler` package unfortunately, the current `Dockerfile` does not set the `PATH` variable correctly. the `RUN` directive is evaluated at build time. thus, the `$HOME` variable is resolved correctly to `/root/` when installing the `protoc` binary; the binary ends up in `/root/.local/bin/protoc`. in contrast, an `ENV` directive is evaluated at a container's runtime, so if `$HOME` is not correctly set at runtime, the `PATH` addition `$HOME/.local/bin` resolves to `/.local/bin`, which does not exist. since the linked docs now also recommend to use a package manager to install the `protoc` compiler, the `Dockerfile` does the same now. at the time of writing, bookworm's version is `libprotoc 3.21.12`, which is higher than the required version of `3.15`. * add `libprotobuf-dev` to include google's common proto type files
1 parent 2093551 commit a17292d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.devcontainer/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
55
&& apt-get purge -y imagemagick imagemagick-6-common
66

77
# Add protoc
8-
# https://datafusion.apache.org/contributor-guide/getting_started.html#protoc-installation
9-
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protoc-25.1-linux-x86_64.zip \
10-
&& unzip protoc-25.1-linux-x86_64.zip -d $HOME/.local \
11-
&& rm protoc-25.1-linux-x86_64.zip
12-
13-
ENV PATH="$PATH:$HOME/.local/bin"
8+
# https://datafusion.apache.org/contributor-guide/development_environment.html#protoc-installation
9+
RUN apt-get update \
10+
&& apt-get install -y --no-install-recommends protobuf-compiler libprotobuf-dev \
11+
&& rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)