Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
build: Dockerfile uses Rust version from `rust-toolchain.toml`
Fintan Halpenny committed 11 months ago
commit 7dcfe45781fb94a6c5df4991382dd3cf16a296f4
parent 924b93283c5bf37bf7d414d1b37cc4574f527fc4
3 files changed +13 -1
modified build/Dockerfile
@@ -1,5 +1,8 @@
# Builds release binaries for Radicle.
-
FROM rust:1.80-alpine3.20 as builder
+
ARG RUST_VERSION="1.85"
+
ARG ALPINE_VERSION="3.20"
+

+
FROM rust:${RUST_VERSION}-alpine${ALPINE_VERSION} as builder
LABEL maintainer="Radicle Team <team@radicle.xyz>"
WORKDIR /src
COPY . .
modified build/build
@@ -27,6 +27,7 @@ main() {
  keypath="$(rad path)/keys/radicle.pub"
  version="$(build/version)"
  image=radicle-build-$version
+
  rust_version="$(build/rust-version)"

  if [ ! -f "$keypath" ]; then
    echo "fatal: no key found at $keypath" >&2 ; exit 1
@@ -40,6 +41,7 @@ main() {

  echo "Building image ($image).."
  podman --cgroup-manager=cgroupfs build \
+
    --build-arg "RUST_VERSION=$rust_version" \
    --build-arg SOURCE_DATE_EPOCH \
    --build-arg TZ \
    --build-arg LC_ALL \
added build/rust-version
@@ -0,0 +1,7 @@
+
#!/bin/sh
+

+
if ! version=$(grep -m 1 -oP "channel\s*=\s*\K(.*)" rust-toolchain.toml); then
+
  echo "fatal: no rust version found via rust-toolchain.toml" >&2 ; exit 1
+
fi
+

+
echo "$version"