# containerised builds references: - https://medium.com/@kasthor/cross-compiling-rust-from-macos-to-linux-using-podman-f654a49f2288 ## quantus chain ### ubuntu container file: `ubuntu.cf` a container build definition file that installs the dependencies, targets and toolchains required to build quantus chain on ubuntu. ```= FROM --platform=linux/amd64 rust:latest ARG RUSTUP_TOOLCHAIN=stable ENV RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN} ENV CARGO_TERM_COLOR=always ENV CARGO_INCREMENTAL=0 RUN apt-get update && apt-get install -yqq --no-install-recommends \ libclang-dev \ protobuf-compiler RUN rustup toolchain install ${RUSTUP_TOOLCHAIN} RUN rustup target add wasm32-unknown-unknown --toolchain ${RUSTUP_TOOLCHAIN}-x86_64-unknown-linux-gnu RUN rustup component add rust-src --toolchain ${RUSTUP_TOOLCHAIN}-x86_64-unknown-linux-gnu RUN rustup default ${RUSTUP_TOOLCHAIN} WORKDIR /usr/src/build CMD ["cargo", "build", "--locked", "--release"] ``` ### build ubuntu container: `ubuntu-builder` ```bash= podman build --tag ubuntu-builder --file ubuntu.cf ``` ### build quantus chain (in the ubuntu container) ```bash= podman run \ -ti \ -v $(pwd):/usr/src/build:Z \ -v cargo-git:/home/rust/.cargo/git \ -v cargo-registry:/home/rust/.cargo/registry \ ubuntu-builder \ cargo build --locked --release ``` ## quantus miner ### build ubuntu container: `cuda-builder` ```bash= podman build \ --tag quantus-network/cuda-builder:12.9.0 \ --file cuda-builder.cf ```