cln/contrib/docker/Dockerfile.builder.fedora
daywalker90 608f6952ea cln-grpc: vendor protoc as a build-dependency
our current version of `grpcio-tools` 1.75.1 bundles `protoc` version:

```
uv run python -m grpc_tools.protoc --version
libprotoc 31.1
```

In CI/Dockerfiles we use 29.4 or whatever the OS provides with the
`protobuf-compiler` package, which for the most part is 21.12.

We actually want to somewhat match these versions but we don't have any
control over OS packages' versions.

We can instead bundle `protoc` as a build dependency for `cln-grpc`.
The current version for that bundles 31.1 as well.

This way the versions of `protoc` are more consistent everywhere.

One downside is that arm 32-bit hosts get no bundled protoc for `cln-grpc`
and have to still install `protobuf-compiler` themselves.

Changelog-None
2026-07-13 18:15:24 +02:00

63 lines
1.6 KiB
Text

FROM fedora:40
ENV UV_PYTHON=3.12
ENV BITCOIN_VERSION=27.1
ENV SOURCE_DATE_EPOCH=1672531200
ENV RUSTFLAGS="-C link-arg=-Wl,--build-id=none"
WORKDIR /tmp
RUN dnf update -y && \
dnf groupinstall -y \
'C Development Tools and Libraries' \
'Development Tools' && \
dnf install -y \
clang \
libsq3-devel \
redhat-lsb \
net-tools \
valgrind \
wget \
git \
jq \
xz \
zlib-devel \
libsodium-devel \
which \
sed \
gettext-devel \
gmp-devel \
python3-devel \
python3-pip \
python3-poetry \
postgresql-devel && \
dnf clean all
# Install Rust via rustup (for lockfile v4 support)
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.92.0
ENV PATH="/root/.cargo/bin:${PATH}"
# Install lowdown
RUN wget https://github.com/kristapsdz/lowdown/archive/refs/tags/VERSION_1_0_2.tar.gz && \
tar -xzf VERSION_1_0_2.tar.gz && \
cd lowdown-VERSION_1_0_2 && \
./configure && \
make && \
make install && \
ldconfig && \
cd /tmp && \
rm -rf VERSION_1_0_2.tar.gz lowdown-VERSION_1_0_2
# Install Bitcoin Core
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \
-O bitcoin.tar.gz && \
tar -xvzf bitcoin.tar.gz && \
mv bitcoin-$BITCOIN_VERSION/bin/bitcoin* /usr/local/bin/ && \
mv bitcoin-$BITCOIN_VERSION/lib/* /usr/local/lib/ && \
mv bitcoin-$BITCOIN_VERSION/include/* /usr/local/include/ && \
mv bitcoin-$BITCOIN_VERSION/share/man/man1/* /usr/share/man/man1 && \
rm -rf bitcoin.tar.gz bitcoin-$BITCOIN_VERSION
# Install uv
ENV PATH="${PATH}:/root/.local/bin"
RUN wget -qO- https://astral.sh/uv/install.sh | sh