From 4f726f646354ff6634555791c0d9d460ef1875d2 Mon Sep 17 00:00:00 2001 From: Gordon Stein <7331488+gsteinLTU@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:52:18 -0600 Subject: [PATCH] Add xx to dockerfile --- Dockerfile-server | 5 ++++- roboscapesim-server/src/util/util.rs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile-server b/Dockerfile-server index 052ffd9..4477a3f 100644 --- a/Dockerfile-server +++ b/Dockerfile-server @@ -1,5 +1,8 @@ +FROM --platform=${BUILDPLATFORM:-linux/amd64} tonistiigi/xx AS xx FROM --platform=${BUILDPLATFORM:-linux/amd64} rust AS builder +COPY --from=xx / / + ARG TARGETPLATFORM ARG BUILDPLATFORM @@ -9,7 +12,7 @@ WORKDIR /roboscape_build COPY . . WORKDIR /roboscape_build/roboscapesim-server -RUN cargo b -r +RUN xx-cargo b -r FROM debian:bookworm-slim diff --git a/roboscapesim-server/src/util/util.rs b/roboscapesim-server/src/util/util.rs index 107ed30..57623e1 100644 --- a/roboscapesim-server/src/util/util.rs +++ b/roboscapesim-server/src/util/util.rs @@ -15,6 +15,7 @@ pub(crate) fn bool_val(val: &Value) -> bool { } } +/// Get string value from JSON value, with implicit conversion from other types pub(crate) fn str_val(val: &Value) -> String { match val { Value::Bool(b) => if *b { "true".to_string() } else { false.to_string() },