#!/bin/bash # Script to build and convert the Docker image to WASM # Step 1: Build the Docker image echo "Building the 32-bit Jupyter Docker image..." docker build -t jupyter-datascience-32bit -f Dockerfile . # Step 2: Install Docker-WASM tools echo "Installing Docker-WASM conversion tools..." npm install -g @wasmer/wasm-transformer npm install -g docker-wasm-cli # Step 3: Export the Docker image echo "Exporting Docker image to a tarball..." docker save jupyter-datascience-32bit -o jupyter-datascience-32bit.tar # Step 4: Convert the Docker image to WASM echo "Converting Docker image to WASM format..." docker-wasm convert jupyter-datascience-32bit.tar --output jupyter-datascience.wasm # Step 5: Create a simple HTML launcher echo "Creating HTML launcher for the WASM module..." cat > jupyter-wasm-launcher.html << 'EOL' Jupyter WASM Instance

Jupyter WASM Instance

This page runs a Jupyter notebook server directly in your browser using WebAssembly.

Status: Ready to launch
EOL echo "Done! You now have:" echo "1. jupyter-datascience.wasm - The WASM module" echo "2. jupyter-wasm-launcher.html - A HTML launcher for the WASM module" echo "" echo "To use, serve these files with a web server that supports WebAssembly and WASM-compatible headers."