Use Alpine to build the runtime

Smaller, works without issue.
This commit is contained in:
Luke Parker
2025-11-12 23:02:22 -05:00
parent 4ebf9ad9c7
commit bcd68441be
2 changed files with 5 additions and 11 deletions

View File

@@ -1,14 +1,7 @@
# rust:1.91.1-slim-trixie as of November 11th, 2025 (GMT) # rust:1.91.1-alpine as of November 11th, 2025 (GMT)
FROM --platform=linux/amd64 rust@sha256:ccdbe08a0b10498bc5f3cac3d736af7b8eb6cb0ecfc1e8a504e93d8ee76a8e8e AS deterministic FROM --platform=linux/amd64 rust@sha256:700c0959b23445f69c82676b72caa97ca4359decd075dca55b13339df27dc4d3 AS deterministic
# Move to a Debian package snapshot RUN apk add musl-dev=1.2.5-r10
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
# Add the wasm toolchain # Add the wasm toolchain
RUN rustup target add wasm32v1-none RUN rustup target add wasm32v1-none
@@ -35,6 +28,7 @@ ADD AGPL-3.0 /serai
WORKDIR /serai WORKDIR /serai
# Build the runtime, copying it to the volume if it exists # Build the runtime, copying it to the volume if it exists
ENV RUSTFLAGS="-Ctarget-feature=-crt-static"
CMD cargo build --release -p serai-runtime && \ CMD cargo build --release -p serai-runtime && \
mkdir -p /volume && \ mkdir -p /volume && \
cp /serai/target/release/wbuild/serai-runtime/serai_runtime.wasm /volume/serai.wasm cp /serai/target/release/wbuild/serai-runtime/serai_runtime.wasm /volume/serai.wasm

View File

@@ -7,7 +7,7 @@ pub fn reproducibly_builds() {
use dockertest::{PullPolicy, Image, TestBodySpecification, DockerTest}; use dockertest::{PullPolicy, Image, TestBodySpecification, DockerTest};
const RUNS: usize = 3; 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()); serai_docker_tests::build("runtime".to_string());