Containerized version of Moscow ML (version 2.10.2) for easy cross-platform usage.
- Docker and Docker Compose installed and running
-
Clone the repository:
git clone https://github.com/Francesco146/mosml-docker.git cd mosml-docker -
Run Moscow ML using the provided script (bash, PowerShell, or Fish):
# Interactive mode ./mosml.sh # Run a specific file ./mosml.sh myprogram.sml # Pass Moscow ML options ./mosml.sh -P full myprogram.sml
The wrapper scripts will automatically:
- Try to pull the pre-built image from GitHub Container Registry
- Fall back to building locally with Docker Compose if the pull fails
- Create a
src/directory for your SML files - Mount it to the container automatically
Run the hello world program from src/hello.sml:
./mosml.sh hello.smlAny SML files you place in the src/ directory will be accessible inside the container at /workspace. You can edit them on your host machine and run them inside the container:
./mosml.sh myprogram.smlOr using the REPL interactively:
- use "myprogram.sml";If you prefer to use Docker Compose directly without the wrapper scripts:
# Build the image
docker compose build
# Run interactively
docker compose run --rm mosml
# Run a specific file
docker compose run --rm mosml hello.sml
# Pass Moscow ML options
docker compose run --rm mosml -P full myprogram.smlThis image is built for linux/amd64 architecture. On Apple Silicon (M1/M2/M3) Macs, Docker will automatically use Rosetta emulation.