Sign inSign up

hemashushu/moonbit

By hemashushu

Updated over 2 years ago

A quick start docker image for Moonbit programming language (https://www.moonbitlang.com/)

Image
0

428

hemashushu/moonbit repository overview

Moonbit Docker Image

This is a quick start docker image for the Moonbit programming language

Quick start

To get started the first Moonbit program, follow these instructions:

  1. Pull this docker image
$ docker pull hemashushu/moonbit
  1. Run this container
$ docker run -it --rm hemashushu/moonbit
  1. Create the first Moonbit program

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
  1. Run the program
$ cd my-project
$ moon run main
Hello, world!

Share files with the host

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_projects in 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.

Repo

Tag summary

Content type

Image

Digest

sha256:3bd20ab6a

Size

102.2 MB

Last updated

over 2 years ago

docker pull hemashushu/moonbit