A quick start docker image for Moonbit programming language (https://www.moonbitlang.com/)
428
This is a quick start docker image for the Moonbit programming language
To get started the first Moonbit program, follow these instructions:
$ docker pull hemashushu/moonbit
$ docker run -it --rm hemashushu/moonbit
To create a new module, enter the moon new command in the terminal, and you will see the module creation wizard. By using all the default values, you can create a new module named hello in the my-project directory.
$ moon new
Enter the path to create the project (. for current directory): my-project
Select the create mode: exec
Enter your username: username
Enter your project name: hello
Enter your license: Apache-2.0
Created my-project
$ cd my-project
$ moon run main
Hello, world!
You can share files with the host to compile or run Moonbit projects located on the host in the container.
The following assumes that the path to your Moonbit project files on the host is /home/yang/moonbit_projects. Use the following command to start the container:
docker run \
-it --rm \
--mount type=bind,source="/home/yang/moonbit_projects",target=/root/moonbit_projects \
hemashushu/moonbit
Remember to replace
/home/yang/moonbit_projectsin the above command with your project path.
After entering the container, you will find a moonbit_projects folder. Create, compile, and run your Moonbit programs in this folder.
Content type
Image
Digest
sha256:3bd20ab6a…
Size
102.2 MB
Last updated
over 2 years ago
docker pull hemashushu/moonbit