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 <fintan.halpenny@gmail.com>
This commit is contained in:
Sebastian Martinez
2025-06-06 10:07:51 +02:00
co-authored by Fintan Halpenny
parent e76f78824f
commit 915fdc3665
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -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 <team@radicle.xyz>"
WORKDIR /src
COPY . .
+3
View File
@@ -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 \