# Installing and Running Modelio (5.1) in a docker container on Mac OS X Author: J Paul Gibson Version 3 - http://jpaulgibson.synology.me/~jpaulgibson/TSP/Teaching/CSC4102/Modelio5-Docker-Mac-OSX.md Html version available at : http://jpaulgibson.synology.me/~jpaulgibson/TSP/Teaching/CSC4102/Modelio5-Docker-Mac-OSX.html 22nd February 2023 Tested on MAC OSX - Ventura 13.0 INTEL chip (important for Docker install) ## 1 - Installation XQuartz (xterm) (5 minutes approx.) Download page - https://www.xquartz.org XQuartz-2.8.5.pkg 2.8.5 2023-01-26 For macOS 10.9 or later (107MB approx) ![xquartz download page](XQuartz-Download.png) (More information - https://www.x.org/wiki/) Double click the package 'XQuartz-2.8.5.pkg' file to install (in your Applications/Utilities folder) Open it by double clicking on the file name "XQuartz.app" *I recommend you keep it in your Dock for easy access* **TODO** - check the version - 2.8.5 **TODO** - in Preferences -> Security check "Authenticate connections" and "Allow connections from network clients" **TODO** ** RESTART XQuartz ** ### XTERM HINTS - 1. if the terminal text is too small you can adjust FONT properties during execution by CONTROL-right-click inside the window 2. CUT and PASTE inside the xterm is done using COMMAND-left-click and OPTION-left-click ## 2 Installation docker (15 minutes approx) https://docs.docker.com/desktop/install/mac-install/ ![docker install and page](InstallDockerOSX.png) **NOTE**: Tested on Mac with INTEL chip (not with Apple Silicon) Requirements - macOS must be version 11 or newer. That is Big Sur (11), Monterey (12), or Ventura (13) Download Docker disk image "Docker.dmg" corresponding to the chipset of your Mac - Intel chip or Apple silicon (650MB approx) Double-click Docker.dmg to open the installer, then drag the Docker icon to the Applications folder. Double-click Docker.app in the Applications folder to start Docker. Select Accept (terms) to continue. Docker Desktop starts after you accept the terms. ![docker running on Mac OS X](RunningDocker.png) **TODO** - Check the version - Docker Desktop 4.16.2 (95914) *I recommend you keep it in your Dock for easy access* ## 3 Running MODELIO 5.1 in Docker (10 minutes approx) (Based on the instructions from Olivier Berger at https://github.com/olberger/docker-modelio branch 5.1) 1. Open an XQuartz terminal 2. Run docker 3. Inside the XQuartz Terminal - 3.1 INTEL MACS % git clone https://github.com/olberger/docker-modelio "Cloning into 'docker-modelio'... remote: Enumerating objects: 182, done. remote: Counting objects: 100% (177/177), done. remote: Compressing objects: 100% (83/83), done. remote: Total 182 (delta 98), reused 142 (delta 72), pack-reused 5 Receiving objects: 100% (182/182), 32.17 KiB | 1.89 MiB/s, done. Resolving deltas: 100% (98/98), done." % cd docker-modelio % git checkout 5.1 branch '5.1' set up to track 'origin/5.1'. Switched to a new branch '5.1' % ls "Dockerfile README.md modelio.config scripts LICENSE entrypoint.sh run.sh" % chmod +x run.sh % ./run.sh "127.0.0.1 being added to access control list MacBook-Pro-Paul.local being added to access control list Inside the running container... You can now launch Modelio 5.1 by invoking '/usr/bin/modelio-open-source5.1' at the bash prompt, and quit with 'exit' at the end." modelio@docker-desktop:~$ /usr/bin/modelio-open-source5.1 3.2 M1/M2 (AMD) MACS In Xquartz: macos:% xhost +localhost macos:% DISPLAY=docker.for.mac.host.internal:0 To find the ID of the image to use: macos:% docker images Then use the ID (replace image_id with the correct ID value) in the following command macos:% docker run -e DISPLAY=$DISPLAY -v /tmp/X11-unix:/tmp/.X11-unix --platform linux/amd64 -i -t image_id You should now have a Modelio 5.1 window open on your desktop ![Modelio 5.1 running on docker container in Mac OS X](RunningModelio5.1.png) When you close your docker container, the files in your workspace can be found in the "Modelio" directory inside your home directory.