diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7fbe7f4c2b2..c1b27ab3d82 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,6 +8,7 @@ on: - "**" paths: - 'docker/Dockerfile' + - 'docker/compose.sh' - 'Cargo.toml' - '.github/workflows/docker.yml' workflow_dispatch: diff --git a/docker/compose.sh b/docker/compose.sh index e0d9371807e..bcdcf885c0b 100755 --- a/docker/compose.sh +++ b/docker/compose.sh @@ -28,7 +28,21 @@ cleanup() { trap cleanup EXIT INT cd "$ROOT_DIR" -docker build -f docker/Dockerfile . -t linera-test + +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + docker build -f docker/Dockerfile . -t linera-test +elif [[ "$OSTYPE" == "darwin"* ]]; then + CPU_ARCH=$(sysctl -n machdep.cpu.brand_string) + if [[ "$CPU_ARCH" == *"Apple"* ]]; then + docker build --build-arg target=aarch64-unknown-linux-gnu -f docker/Dockerfile -t linera-test . + else + echo "Unsupported Architecture: $CPU_ARCH" + exit 1; + fi +else + echo "Unsupported OS: $OSTYPE" + exit 1; +fi cd "$SCRIPT_DIR"