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 ac7af40f2e
commit 4f82e5912c
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)
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