From f45330a006a019b6892094a9cb734dd497add7c0 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 24 Jul 2025 11:55:29 +0200 Subject: Added stuff to Dockerfile, switched to Debian for Emscripten compatibility --- Dockerfile | 26 ++++++++++++++++++-------- container-run.sh | 8 ++++---- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index a18a9cd..8362741 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,13 +7,23 @@ # # docker run --platform=linux/arm64 -t localhost/nissy-dev/arm ./build test -# TODO: add C++ compiler, emscripten +FROM debian:12 -FROM alpine:3.22.1 -RUN apk update && apk add \ - gcc \ - clang \ - python3 \ - python3-dev +# Install necessary packages +RUN apt update +RUN apt install --yes xz-utils git gcc g++ clang python3 python3-dev -COPY . ./ +# Install emscripten. +RUN git clone https://github.com/emscripten-core/emsdk.git +WORKDIR /emsdk +RUN ./emsdk install 4.0.11 +RUN ./emsdk activate 4.0.11 +ENV EMSDK="/emsdk" +ENV EMSDK_NODE_BIN="$EMSDK/node/22.16.0_64bit/bin" +ENV EMSDK_NODE="$EMSDK_NODE_BIN/node" +ENV PATH="$EMSDK:$EMSDK/upstream/emscripten:$EMSDK_NODE_BIN:$PATH" + +# Copying the nissy-core repository and switching to that folder. +WORKDIR / +COPY . ./nissy-core +WORKDIR /nissy-core diff --git a/container-run.sh b/container-run.sh index 9799f65..6865e32 100755 --- a/container-run.sh +++ b/container-run.sh @@ -7,7 +7,7 @@ # ./container-run.sh arm ./build test # # builds nissy and runs the unit tests in an ARM container. -# The container images are based on Alpine Linux, see Dockerfile for details. +# The container images are based on Debian Linux, see Dockerfile for details. # The images are built with a tag starting with 'localhost/nissy/'. # See below for a list of options. @@ -46,12 +46,12 @@ arm|arm64) esac platform="--platform=linux/$p" -image="localhost/nissy/alpine-$p" +image="localhost/nissy/debian-$p" docker build "$platform" -t "$image" . if [ -z "$2" ]; then - docker run "$platform" -it "$image" /bin/sh + docker run --rm "$platform" -it "$image" /bin/sh else - docker run "$platform" -t "$image" $@ + docker run --rm "$platform" -t "$image" $@ fi -- cgit v1.3