From 435107ce4faeab84678fcd1d7c44837025c6ae68 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 15 Aug 2025 19:09:44 +0200 Subject: Updates to container runner and removed simd from wasm build --- utils/container-run.sh | 60 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 20 deletions(-) (limited to 'utils') diff --git a/utils/container-run.sh b/utils/container-run.sh index 6090e1c..df17b74 100755 --- a/utils/container-run.sh +++ b/utils/container-run.sh @@ -24,8 +24,9 @@ usage() { echo "If COMMAND is unspecified, an interactive shell will be opened." echo "" echo "Available platforms:" - echo "x86 (equivalent to: x86_64, amd64)" - echo "arm (equivalent to: arm64)" + echo "x86 (equivalent to: x86_64, amd64)" + echo "arm (equivalent to: arm64)" + echo "emscripten" echo "" echo "Examples:" echo "$0 ram ./build.sh test # Run unit tests in arm container" @@ -36,13 +37,48 @@ if [ -z "$1" ]; then usage "No platform given." fi +config_standard() { + image="localhost/nissy/alpine-$1" + platform="--platform=linux/$1" + mount="--mount type=bind,src=./,dst=/nissy-core" + flags="--rm --privileged" + + dockerfile="$(mktemp)" + cat > "$dockerfile" << EOF + FROM alpine:3.22 + RUN apk update + RUN apk add gcc g++ clang python3 python3-dev + RUN mkdir /nissy-core + WORKDIR /nissy-core + USER 1000:1000 +EOF +} + +config_emscripten() { + image="localhost/nissy/emscripten" + platform="--platform=linux/amd64" + mount="--mount type=bind,src=./,dst=/nissy-core" + flags="--rm --privileged" + + dockerfile="$(mktemp)" + cat > "$dockerfile" << EOF + FROM emscripten/emsdk + WORKDIR /nissy-core + USER 1000:1000 +EOF +} + case "$1" in x86|x86_64|amd64) - p=amd64 + config_standard amd64 shift ;; arm|arm64) - p=arm64 + config_standard arm64 + shift + ;; +emscripten) + config_emscripten shift ;; *) @@ -50,22 +86,6 @@ arm|arm64) ;; esac -image="localhost/nissy/alpine-$p" -platform="--platform=linux/$p" -mount="--mount type=bind,src=./,dst=/nissy-core" -flags="--rm --privileged" - -dockerfile="$(mktemp)" -cat > "$dockerfile" << EOF -FROM alpine:3.22.1 -RUN apk update -RUN apk add gcc g++ clang python3 python3-dev -#COPY . ./nissy-core -RUN mkdir /nissy-core -WORKDIR /nissy-core -USER 1000:1000 -EOF - docker build "$platform" -f "$dockerfile" -t "$image" . rm "$dockerfile" -- cgit v1.3