mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
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:
co-authored by
Fintan Halpenny
parent
e76f78824f
commit
915fdc3665
@@ -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 . .
|
||||
|
||||
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user