From bcd68441be9e26abac3a15bc58353c8652531c8f Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Wed, 12 Nov 2025 23:02:22 -0500 Subject: [PATCH] Use Alpine to build the runtime Smaller, works without issue. --- orchestration/runtime/Dockerfile | 14 ++++---------- tests/reproducible-runtime/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/orchestration/runtime/Dockerfile b/orchestration/runtime/Dockerfile index 7885098d..f573c338 100644 --- a/orchestration/runtime/Dockerfile +++ b/orchestration/runtime/Dockerfile @@ -1,14 +1,7 @@ -# rust:1.91.1-slim-trixie as of November 11th, 2025 (GMT) -FROM --platform=linux/amd64 rust@sha256:ccdbe08a0b10498bc5f3cac3d736af7b8eb6cb0ecfc1e8a504e93d8ee76a8e8e AS deterministic +# rust:1.91.1-alpine as of November 11th, 2025 (GMT) +FROM --platform=linux/amd64 rust@sha256:700c0959b23445f69c82676b72caa97ca4359decd075dca55b13339df27dc4d3 AS deterministic -# Move to a Debian package snapshot -RUN rm -rf /etc/apt/sources.list.d/debian.sources && \ - rm -rf /var/lib/apt/lists/* && \ - echo "deb [arch=amd64] http://snapshot.debian.org/archive/debian/20251111T000000Z trixie main" > /etc/apt/sources.list && \ - apt update - -# Install dependencies -RUN apt update -y && apt upgrade -y && apt install -y clang +RUN apk add musl-dev=1.2.5-r10 # Add the wasm toolchain RUN rustup target add wasm32v1-none @@ -35,6 +28,7 @@ ADD AGPL-3.0 /serai WORKDIR /serai # Build the runtime, copying it to the volume if it exists +ENV RUSTFLAGS="-Ctarget-feature=-crt-static" CMD cargo build --release -p serai-runtime && \ mkdir -p /volume && \ cp /serai/target/release/wbuild/serai-runtime/serai_runtime.wasm /volume/serai.wasm diff --git a/tests/reproducible-runtime/src/lib.rs b/tests/reproducible-runtime/src/lib.rs index 3421026d..025039b7 100644 --- a/tests/reproducible-runtime/src/lib.rs +++ b/tests/reproducible-runtime/src/lib.rs @@ -7,7 +7,7 @@ pub fn reproducibly_builds() { use dockertest::{PullPolicy, Image, TestBodySpecification, DockerTest}; const RUNS: usize = 3; - const TIMEOUT: u16 = 180 * 60; // 3 hours + const TIMEOUT: u16 = 3 * 60 * 60; // 3 hours serai_docker_tests::build("runtime".to_string());