docker: Added fixed SOURCE_DATE_EPOCH flag for reproducible Fedora build

- Using environment variable `SOURCE_DATE_EPOCH` with fixed value will enforce a consistent timestamp for Fedora build.
. Similar to Ubuntu fix in commit 490fb0fc3b
- Locked cargo version
- Add `no-cache` to Fedora build

Changelog-Fixed: Core lightning builds for Fedora on all systems are deterministic.
This commit is contained in:
ShahanaFarooqui
2026-01-15 18:43:19 -08:00
parent 12ccfb5c65
commit ec7d247f38
2 changed files with 4 additions and 3 deletions

View File

@@ -2,6 +2,8 @@ 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
@@ -20,7 +22,6 @@ RUN dnf update -y && \
jq \
xz \
zlib-devel \
cargo \
libsodium-devel \
which \
sed \
@@ -35,7 +36,7 @@ RUN dnf update -y && \
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 stable
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

View File

@@ -177,7 +177,7 @@ for target in $TARGETS; do
TAG=fedora
DOCKERFILE=contrib/docker/Dockerfile.builder.fedora
FEDORA_VERSION=$(grep -oP '^FROM fedora:\K[0-9]+' "$DOCKERFILE")
docker build -f $DOCKERFILE -t $TAG --load .
docker build --no-cache -f $DOCKERFILE -t $TAG --load .
docker run --rm=true -v "$(pwd)":/src:ro -v "$RELEASEDIR":/release $TAG /src/tools/build-release.sh --inside-docker "$VERSION" "$platform" "$FEDORA_VERSION" "$ARCH" "$MAKEPAR"
docker run --rm=true -w /build $TAG rm -rf /"$VERSION-$platform-$FEDORA_VERSION-$ARCH" /build
echo "Fedora Image Built"