Changes between Version 17 and Version 18 of docker
- Timestamp:
- 11/17/20 09:42:23 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
docker
v17 v18 4 4 = Installing Matlab on Docker = 5 5 6 To install Matlab on Docker you will nee to download the full installation files, in addition to a file installation key and license file. Under an academic headcount license through the Unversity of Montana. First create a directory to contain the installation files 6 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. 7 7 8 8 9 {{{ 9 10 #!sh 10 11 mkdir issm_docker 11 mkdir issm_docker/license12 12 }}} 13 13 14 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. 14 15 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. 15 16 16 17 [[Image(shot1.png,800px)]] … … 24 25 {{{ 25 26 #!sh 26 cp license.lic issm_docker /license27 cp license.lic issm_docker 27 28 }}} 28 29 29 Next you will need to download all Matlab installation files. Download the Matlab installer from the license center, unzip the directory, and run the installer. Login with your Mathworks account, accept the license agreement, then under advanced options, select "I want to download without installing." I downloaded the installation files to issm_docker/R2020b. 30 31 Once installation files have been downloaded, create a file called installer_options.txt in issm_docker with 30 Creat a text file called installer_input.txt with the following contents 32 31 {{{ 33 32 #!sh … … 39 38 outputFile=log.txt 40 39 40 licensePath=../license.lic 41 42 41 43 }}} 42 replacing <key> with the file installation key you received. You should now have an issm_docker directory containing a licenses folder with the downloaded license, an installer_options.txt file, and a subdirectory containing the matlab install files (e.g. R2020b).44 replacing <key> with the file installation key you received. 43 45 44 Create a dockerfile in issm_docker with the following contents 46 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 47 48 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 45 49 46 50 {{{ 47 #!sh48 51 # Use the official image as a parent image. 49 52 FROM ubuntu:20.04 … … 53 56 RUN apt-get install -y libx11-6 54 57 RUN apt-get install -y emacs 55 #RUN apt-get -y install sudo56 #RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo57 58 58 59 # Copy the file from your host to your current location. … … 60 61 61 62 # Add matlab files 62 ADD R2020b ./R2020b 63 ADD matlab ./matlab 64 ADD installer_input.txt ./ 65 ADD license.lic license.lic ./ 63 66 64 67 # Install Matlab 65 WORKDIR /home/issm/ R2020b66 RUN ./install -inputFile installer_options.txt68 WORKDIR /home/issm/matlab/ 69 RUN ./install -inputFile ../installer_input.txt 67 70 68 WORKDIR /usr/local/MATLAB/R2020b/ 69 ADD licenses ./licenses 70 71 # Create matlab alias with desktop disabled 72 RUN echo 'alias matlab="/usr/local/MATLAB/R2020a/bin/matlab -nojvm -nodesktop"' >> ~/.bashrc 71 73 }}} 72 74 75 76 Upon completion, you can verify the installation by starting an interactive session 77 78 79 {{{ 80 docker run -t -i --mac-address 02:42:ac:11:00:02 ubuntu/issm 81 root@fe63a6d5e729:/home/issm/matlab# matlab 82 MATLAB is selecting SOFTWARE OPENGL rendering. 83 84 < M A T L A B (R) > 85 Copyright 1984-2020 The MathWorks, Inc. 86 R2020a (9.8.0.1323502) 64-bit (glnxa64) 87 February 25, 2020 88 89 90 For online documentation, see https://www.mathworks.com/support 91 For product information, visit www.mathworks.com. 92 93 >> 94 }}}