== Install ISSM on Docker == = Installing Matlab on Docker = To install Matlab on Docker we will create a directory containing the full Matlab installation files, a license file, and a text file with the installer configuration options. {{{ #!sh mkdir issm_docker }}} Under an academic total headcount license through the Unversity of Montana, I was able to get an installation key and license by logging into my Mathworks account, going to the "install and activate" tab, then clicking "activate to retrieve license file" under related tasks. From there, click "active a computer". The Matlab license is tied to a specific username and MAC address, so in order to get it to work in Docker, specify the login name as "root", which is the Docker default, and set the mac address to 02:42:ac:11:00:02. The license MAC address needs to match the MAC address in the Docker container, which can be specified at runtime. [[Image(shot1.png,800px)]] Submit this form, then click no on the next page. [[Image(shot2.png,800px)]] Click continue and you will receive a file installation key and license file. Place the license file in issm_docker/license. {{{ #!sh cp license.lic issm_docker }}} Creat a text file called installer_input.txt with the following contents {{{ #!sh fileInstallationKey= agreeToLicense=yes outputFile=log.txt licensePath=../license.lic }}} replacing with the file installation key you received. Next, we need all Matlab install files. Download the Matlab installer from the license center and run it. Login with your Mathworks account, accept the license agreement, then under advanced options, select "I want to download without installing." Download the files to docker_issm/matlab The issm_docker directory should now have a license file license.lic, the installer_input.txt file, and a directory called matlab with the install files. Create a dockerfile called DOCKERFILE in issm_docker with the following contents {{{ # Use the official image as a parent image. FROM ubuntu:20.04 # Instal x11 libs RUN apt-get update RUN apt-get install -y libx11-6 RUN apt-get install -y emacs # Copy the file from your host to your current location. WORKDIR /home/issm # Add matlab files ADD matlab ./matlab ADD installer_input.txt ./ ADD license.lic license.lic ./ # Install Matlab WORKDIR /home/issm/matlab/ RUN ./install -inputFile ../installer_input.txt # Create matlab alias with desktop disabled RUN echo 'alias matlab="/usr/local/MATLAB/R2020a/bin/matlab -nojvm -nodesktop"' >> ~/.bashrc }}} Upon completion, you can verify the installation by starting an interactive session and running Matlab. {{{ docker run -t -i --mac-address 02:42:ac:11:00:02 ubuntu/issm root@fe63a6d5e729:/home/issm/matlab# matlab MATLAB is selecting SOFTWARE OPENGL rendering. < M A T L A B (R) > Copyright 1984-2020 The MathWorks, Inc. R2020a (9.8.0.1323502) 64-bit (glnxa64) February 25, 2020 For online documentation, see https://www.mathworks.com/support For product information, visit www.mathworks.com. >> }}}