blockchain/docker/Dockerfile.cross-build
Claude a6773abaca
Some checks are pending
Build & Release / Linux x86_64 (push) Waiting to run
Build & Release / macOS ARM64 (push) Waiting to run
Build & Release / Create Release (push) Blocked by required conditions
fix(pos): add --rpc-ignore-offline to all daemon configs
PoS mining requires this flag when the daemon has no peers. Without it,
the daemon's get_pos_mining_details RPC returns DISCONNECTED status and
the wallet refuses to mint.

First PoS blocks minted on testnet at height 12,382.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-03 13:53:07 +01:00

38 lines
1.5 KiB
Text

# Cross-platform build for Lethean blockchain binaries
# Produces Linux x86_64 and ARM64 binaries
# macOS and Windows need native build environments or cross-compilation toolchains
#
# Usage:
# docker build -f Dockerfile.cross-build --target linux-x64 -o ./out .
# docker build -f Dockerfile.cross-build --target linux-arm64 -o ./out .
# === Base builder ===
FROM ubuntu:24.04 AS base-builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
build-essential cmake git python3 python3-pip \
libboost-all-dev libssl-dev pkg-config curl \
&& pip3 install conan --break-system-packages \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY . /build/
# === Linux x86_64 ===
FROM base-builder AS linux-x64-build
ARG TESTNET=1
RUN make build CPU_CORES=$(nproc) TESTNET=${TESTNET} STATIC=1 || \
(cd build/release && cmake --build . --parallel $(nproc))
FROM scratch AS linux-x64
COPY --from=linux-x64-build /build/build/release/src/lethean-* /
# === Linux ARM64 (cross-compile) ===
FROM base-builder AS linux-arm64-build
RUN apt-get update && apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
ARG TESTNET=1
# ARM64 cross-compilation requires CMAKE_TOOLCHAIN_FILE
# This is a placeholder — actual cross-compile needs Conan profile for aarch64
RUN echo "ARM64 cross-compilation requires additional setup. Use native ARM64 builder or QEMU."
FROM scratch AS linux-arm64
# Placeholder — use buildx with --platform=linux/arm64 for native ARM builds