Changes between Version 17 and Version 18 of docker


Ignore:
Timestamp:
11/17/20 09:42:23 (4 years ago)
Author:
downs
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • docker

    v17 v18  
    44= Installing Matlab on Docker =
    55
    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
     6To 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
    78
    89{{{
    910#!sh
    1011mkdir issm_docker
    11 mkdir issm_docker/license
    1212}}}
    1313
    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
     15Under 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.
    1516
    1617[[Image(shot1.png,800px)]]
     
    2425{{{
    2526#!sh
    26 cp license.lic issm_docker/license
     27cp license.lic issm_docker
    2728}}}
    2829
    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
     30Creat a text file called installer_input.txt with the following contents
    3231{{{
    3332#!sh
     
    3938outputFile=log.txt
    4039
     40licensePath=../license.lic
     41
     42
    4143}}}
    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).
     44replacing <key> with the file installation key you received.
    4345
    44 Create a dockerfile in issm_docker with the following contents
     46Next, 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
     48The 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
    4549
    4650{{{
    47 #!sh
    4851# Use the official image as a parent image.
    4952FROM ubuntu:20.04
     
    5356RUN apt-get install -y libx11-6
    5457RUN apt-get install -y emacs
    55 #RUN apt-get -y install sudo
    56 #RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
    5758
    5859# Copy the file from your host to your current location.
     
    6061
    6162# Add matlab files
    62 ADD R2020b ./R2020b
     63ADD matlab ./matlab
     64ADD installer_input.txt ./
     65ADD license.lic license.lic ./
    6366
    6467# Install Matlab
    65 WORKDIR /home/issm/R2020b
    66 RUN ./install -inputFile  installer_options.txt
     68WORKDIR /home/issm/matlab/
     69RUN ./install -inputFile  ../installer_input.txt
    6770
    68 WORKDIR /usr/local/MATLAB/R2020b/
    69 ADD licenses ./licenses
    70 
     71# Create matlab alias with desktop disabled
     72RUN echo 'alias matlab="/usr/local/MATLAB/R2020a/bin/matlab -nojvm -nodesktop"' >> ~/.bashrc
    7173}}}
    7274
     75
     76Upon completion, you can verify the installation by starting an interactive session
     77
     78
     79{{{
     80docker run -t -i --mac-address 02:42:ac:11:00:02 ubuntu/issm
     81root@fe63a6d5e729:/home/issm/matlab# matlab
     82MATLAB 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 
     90For online documentation, see https://www.mathworks.com/support
     91For product information, visit www.mathworks.com.
     92 
     93>>
     94}}}