From 915fdc3665d95f2c0e2e8341715626df67847ba3 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 6 Jun 2025 10:05:56 +0200 Subject: [PATCH] httpd: Dockerfile uses Rust version from rust-toolchain Instead of hardcoding the version of the Rust alpine file, introduce an `ARG` in the `Dockerfile`. In `build/build`, we determine the version by inspecting `rust-toolchain.toml`, and pass this value in. This ensures that the binaries are built using the same toolchain that we develop with. Co-authored-by: Fintan Halpenny --- radicle-httpd/build/Dockerfile | 4 +++- radicle-httpd/build/build | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/radicle-httpd/build/Dockerfile b/radicle-httpd/build/Dockerfile index a9351ddec..4f9b537e1 100644 --- a/radicle-httpd/build/Dockerfile +++ b/radicle-httpd/build/Dockerfile @@ -1,5 +1,7 @@ # Builds release binaries for Radicle. -FROM rust:1.83.0-alpine3.21 as builder +ARG RUST_VERSION="1.87" +ARG ALPINE_VERSION="3.20" +FROM rust:${RUST_VERSION}-alpine${ALPINE_VERSION} as builder LABEL maintainer="Radicle Team " WORKDIR /src COPY . . diff --git a/radicle-httpd/build/build b/radicle-httpd/build/build index b60ddc669..724eae72d 100755 --- a/radicle-httpd/build/build +++ b/radicle-httpd/build/build @@ -34,6 +34,7 @@ main() { keypath="$(rad path)/keys/radicle.pub" version="$(build/version)" image=radicle-build-$version + rust_version="$(cat ./rust-toolchain)" if [ ! -f "$keypath" ]; then echo "fatal: no key found at $keypath" >&2 @@ -51,6 +52,7 @@ main() { case "$OS" in Darwin) podman build \ + --build-arg "RUST_VERSION=$rust_version" \ --build-arg SOURCE_DATE_EPOCH \ --build-arg TZ \ --build-arg LC_ALL \ @@ -63,6 +65,7 @@ main() { ;; *) podman --cgroup-manager=cgroupfs build \ + --build-arg "RUST_VERSION=$rust_version" \ --build-arg SOURCE_DATE_EPOCH \ --build-arg TZ \ --build-arg LC_ALL \