Using Mastercode with Docker on Mac OS


This section is of interest only for members of the Mastercode Collaboration. It is assumed you have already installed Docker for Mac according to the instructions provided.

We are maintaining a container prepared with all the libraries and tools required to run Mastercode. This is the Dockerfile for the Mastercode container in case you want to see in particular which software is installed.

  1. Download Mastercode
  2. Download or Clone using the git tools the last version of Mastercode, on your Machine, from:

    and uncompress the zip file, for example, in your projects directory (/Users/youruserid/projects/). You will need about 1GB of space.

    mkdir projects/

    cd projects/

    mv ../Downloads/ .


    You will end up with a directory called ./projects/mcpp-master/ under you main directory.

  3. Download and Launch the Mastercode Container
  4. Launch the Docker application if you have not already done so, and open a new terminal on the Mac. If Docker was not running previously, you should always open a new terminal for the docker commands to be available.

    In this terminal, download the Mastercode container by:

    docker pull indigodatacloud/docker-mastercode

    Then you can simply launch the container mounting your Mac $HOME directory on the /mnt directory of the container:

    docker run -ti -v /Users/youruserid:/mnt indigodatacloud/docker-mastercode

    You may as well mount only the Mastercode directory, bearing in mind that nothing else from your $HOME will be available inside the container:

    docker run -ti -v /Users/youruserid/projects/mcpp-master:/mnt indigodatacloud/docker-mastercode

    You will end up in a terminal, in which you will appear as root (with the "#" symbol). Do not be impressed by that: it is not a fake root, you will not be altering anything.


    "cat /etc/fedora-release"

    and convince yourself that you are now on Linux. Typing:

    "ls /mnt"

    you will see your $HOME directory, or the directory you decided to mount on the "-v" option.

  5. Compile & Run Mastercode in the container
  6. On the container terminal you can now compile and run Mastercode as usual:

    cd /mnt

    cd projects/mcpp-master




    Will take a while to compile the first time (order of 20 minutes on recent Mac models), as it downloads all the software tools of the different components, and compiles from scratch. When compilation is done, you can already run it:

    ./ --run-mode mc-cmssm --predictors all --inputs 500 600 0 10 --print-mc-spectrum

  7. Remarks
  8. In the typical situation you will be editing your local copy of Mastercode to add features, etc... and compiling and testing it on the container terminal.

    In this respect:

Last updated 3th December 2016