Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cca0724

Browse files
epaganonPrabhakar Kumar
authored andcommittedSep 2, 2024·
Updates MATLAB installation paths to consistenly use "/opt/matlab/R20XXY" as the default installation path, Silent installer workflows will continue to use "/usr/local/MATLAB" to match the behavior of the standard GUI based installer.
fixes #107
1 parent 495630c commit cca0724

File tree

18 files changed

+116
-92
lines changed

18 files changed

+116
-92
lines changed
 

‎.github/workflows/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Each time the image passes the qualification, it is pushed to the GitHub Contain
1818

1919
`ghcr.io/mathworks-ref-arch/matlab-dockerfile/matlab:${matlab-release}`
2020

21-
where `${matlab-release}` is a matlab release (e.g. `r2021a`, `r2021b`, etc..) .
21+
where `${matlab-release}` is a matlab release (e.g. `R2021a`, `R2021b`, etc..) .
2222

2323
## Workflow Description
2424

25-
The workflow consists of a one-dimensional matrix of jobs. Each job builds, tests and publishes the container image for a different MATLAB release, starting from `r2020b`. To ensure that a failure in any job does not cancel other jobs, the `fail-fast` option is set to `false`.
25+
The workflow consists of a one-dimensional matrix of jobs. Each job builds, tests and publishes the container image for a different MATLAB release, starting from `R2020b`. To ensure that a failure in any job does not cancel other jobs, the `fail-fast` option is set to `false`.
2626

2727
Each job consists of the following steps:
2828

‎.github/workflows/build-test-publish.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- "Dockerfile"
1313
- "tests/*"
1414
- "tests/utils/**"
15+
- ".github/workflows/build-test-publish.yml"
1516
- "!**.md"
1617
schedule:
1718
# Run at 00:00 on every Monday (1st Day of the Week)
@@ -27,7 +28,7 @@ jobs:
2728
strategy:
2829
fail-fast: false
2930
matrix:
30-
matlab-release: [r2024a, r2023b, r2023a, r2022b, r2022a, r2021b, r2021a, r2020b]
31+
matlab-release: [R2024a, R2023b, R2023a, R2022b, R2022a, R2021b, R2021a, R2020b]
3132

3233
steps:
3334
- name: Checkout repo
@@ -70,7 +71,15 @@ jobs:
7071
env:
7172
IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}:${{ matrix.matlab-release }}
7273
working-directory: tests
73-
run: python -m unittest
74+
run: python -m unittest -v
7475

7576
- name: Push the image to ghcr.io
76-
run: docker push ${{ env.IMAGE_BASE_NAME }}:${{ matrix.matlab-release }}
77+
env:
78+
MATLAB_RELEASE: ${{ matrix.matlab-release }}
79+
run: |
80+
LOWERCASE_RELEASE=${MATLAB_RELEASE,,}
81+
UPPERCASE_RELEASE=${LOWERCASE_RELEASE^}
82+
docker tag ${{ env.IMAGE_BASE_NAME }}:${MATLAB_RELEASE} ${{ env.IMAGE_BASE_NAME }}:${LOWERCASE_RELEASE}
83+
docker tag ${{ env.IMAGE_BASE_NAME }}:${MATLAB_RELEASE} ${{ env.IMAGE_BASE_NAME }}:${UPPERCASE_RELEASE}
84+
docker push ${{ env.IMAGE_BASE_NAME }}:${LOWERCASE_RELEASE}
85+
docker push ${{ env.IMAGE_BASE_NAME }}:${UPPERCASE_RELEASE}

‎.github/workflows/from-matlab-docker-build-test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- "alternates/building-on-matlab-docker-image/Dockerfile"
1313
- "tests/alternates/building-on-matlab-docker-image/*"
1414
- "tests/utils/**"
15+
- ".github/workflows/from-matlab-docker-build-test.yml"
1516
- "!**.md"
1617
schedule:
1718
# Run at 00:00 on every Monday (1st Day of the Week)
@@ -28,7 +29,7 @@ jobs:
2829
strategy:
2930
fail-fast: false
3031
matrix:
31-
matlab-release: [r2024a, r2023b, r2023a, r2022b, r2022a]
32+
matlab-release: [R2024a, R2023b, R2023a, R2022b, R2022a]
3233

3334
steps:
3435
- name: Checkout repo

‎.github/workflows/matlab-container-offline-install-build-test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- "alternates/matlab-container-offline-install/Dockerfile"
1414
- "tests/alternates/matlab-container-offline-install/*"
1515
- "tests/utils/**"
16+
- ".github/workflows/matlab-container-offline-install-build-test.yml"
1617
- "!**.md"
1718
schedule:
1819
# Run at 00:00 on every Monday (1st Day of the Week)
@@ -31,7 +32,7 @@ jobs:
3132
strategy:
3233
fail-fast: false
3334
matrix:
34-
matlab-release: [r2024a, r2023b, r2023a, r2022b, r2022a, r2021b, r2021a, r2020b]
35+
matlab-release: [R2024a, R2023b, R2023a, R2022b, R2022a, R2021b, R2021a, R2020b]
3536

3637
steps:
3738
- name: Checkout repo
@@ -87,6 +88,4 @@ jobs:
8788
working-directory: tests
8889
env:
8990
IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}:${{ matrix.matlab-release }}
90-
run: |
91-
python -m unittest ${{ env.ALT_PATH }}/test_container.py
92-
python -m unittest ${{ env.ALT_PATH }}/test_installed_products.py
91+
run: python -m unittest -v ${{ env.ALT_PATH }}/*.py

‎.github/workflows/matlab-installer-build-test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- "alternates/matlab-installer/Dockerfile"
1313
- "tests/alternates/matlab-installer/*"
1414
- "tests/utils/**"
15+
- ".github/workflows/matlab-installer-build-test.yml"
1516
- "!**.md"
1617
schedule:
1718
# Run at 00:00 on every Monday (1st Day of the Week)
@@ -30,7 +31,7 @@ jobs:
3031
strategy:
3132
fail-fast: false
3233
matrix:
33-
matlab-release: [r2024a, r2023b, r2023a, r2022b, r2022a, r2021b, r2021a, r2020b]
34+
matlab-release: [R2024a, R2023b, R2023a, R2022b, R2022a, R2021b, R2021a, R2020b]
3435

3536
steps:
3637
- name: Checkout repo
@@ -71,4 +72,4 @@ jobs:
7172
working-directory: tests
7273
env:
7374
IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}:${{ matrix.matlab-release }}
74-
run: python -m unittest ${{ env.ALT_PATH }}/test_mock_matlab_container.py
75+
run: python -m unittest -v ${{ env.ALT_PATH }}/*.py

‎.github/workflows/non-interactive-build-test.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ on:
1010
# Trigger the workflow when the Dockerfile or any file under tests/ is modified
1111
paths:
1212
- "alternates/non-interactive/Dockerfile"
13-
- "alternates/non-interactive/MATLAB-BATCH.md"
14-
- "tests/**"
13+
- "tests/alternates/non-interactive/*"
14+
- "tests/utils/**"
15+
- ".github/workflows/non-interactive-build-test.yml"
1516
- "!**.md"
1617
schedule:
1718
# Run at 00:00 on every Monday (1st Day of the Week)
1819
- cron: "0 0 * * 1"
1920

2021
env:
21-
IMAGE_BASE_NAME: matlab-non-interactive
22+
IMAGE_BASE_NAME: ghcr.io/${{ github.repository }}/matlab-non-interactive
2223
ALT_PATH: alternates/non-interactive
2324

2425
jobs:
@@ -28,7 +29,7 @@ jobs:
2829
fail-fast: false
2930
matrix:
3031
matlab-release:
31-
[r2024a, r2023b, r2023a, r2022b, r2022a, r2021b, r2021a, r2020b]
32+
[R2024a, R2023b, R2023a, R2022b, R2022a, R2021b, R2021a, R2020b]
3233

3334
steps:
3435
- name: Checkout repo
@@ -63,5 +64,15 @@ jobs:
6364
env:
6465
IMAGE_NAME: ${{ env.IMAGE_BASE_NAME }}:${{ matrix.matlab-release }}
6566
BATCH_TOKEN: ${{ secrets.MATLAB_BATCH_TOKEN_EXPIRES_03_2025 }}
67+
run: python -m unittest -v ${{ env.ALT_PATH }}/*.py
68+
69+
- name: Push the image to ghcr.io
70+
env:
71+
MATLAB_RELEASE: ${{ matrix.matlab-release }}
6672
run: |
67-
python -m unittest ${{ env.ALT_PATH }}/test_matlabbatch.py
73+
LOWERCASE_RELEASE=${MATLAB_RELEASE,,}
74+
UPPERCASE_RELEASE=${LOWERCASE_RELEASE^}
75+
docker tag ${{ env.IMAGE_BASE_NAME }}:${MATLAB_RELEASE} ${{ env.IMAGE_BASE_NAME }}:${LOWERCASE_RELEASE}
76+
docker tag ${{ env.IMAGE_BASE_NAME }}:${MATLAB_RELEASE} ${{ env.IMAGE_BASE_NAME }}:${UPPERCASE_RELEASE}
77+
docker push ${{ env.IMAGE_BASE_NAME }}:${LOWERCASE_RELEASE}
78+
docker push ${{ env.IMAGE_BASE_NAME }}:${UPPERCASE_RELEASE}

‎Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
# install, and the location at which to install MATLAB.
55

66
# Here is an example docker build command with the optional build arguments.
7-
# docker build --build-arg MATLAB_RELEASE=r2024a
7+
# docker build --build-arg MATLAB_RELEASE=R2024a
88
# --build-arg MATLAB_PRODUCT_LIST="MATLAB Deep_Learning_Toolbox Symbolic_Math_Toolbox"
99
# --build-arg MATLAB_INSTALL_LOCATION="/opt/matlab/R2024a"
1010
# --build-arg LICENSE_SERVER=12345@hostname.com
1111
# -t my_matlab_image_name .
1212

1313
# To specify which MATLAB release to install in the container, edit the value of the MATLAB_RELEASE argument.
14-
# Use lowercase to specify the release, for example: ARG MATLAB_RELEASE=r2021b
15-
ARG MATLAB_RELEASE=r2024a
14+
# Use uppercase to specify the release, for example: ARG MATLAB_RELEASE=R2021b
15+
ARG MATLAB_RELEASE=R2024a
1616

1717
# Specify the list of products to install into MATLAB.
1818
ARG MATLAB_PRODUCT_LIST="MATLAB"

‎README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ cd matlab-dockerfile
2727

2828
Build container with a name and tag of your choice.
2929
```bash
30-
docker build -t matlab:r2024a .
30+
docker build -t matlab:R2024a .
3131
```
3232

3333
Run the container. Test the container by running an example MATLAB command such as ver.
3434
```bash
35-
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:r2024a -batch ver
35+
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:R2024a -batch ver
3636
```
3737
The [Dockerfile](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/Dockerfile) defaults to building a container for MATLAB R2024a.
3838

@@ -57,9 +57,9 @@ The [Dockerfile](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/ma
5757

5858
| Argument Name | Default value | Description |
5959
|---|---|---|
60-
| [MATLAB_RELEASE](#build-an-image-for-a-different-release-of-matlab) | r2024a | The MATLAB release you want to install, in lower-case. For example: `r2019b`|
60+
| [MATLAB_RELEASE](#build-an-image-for-a-different-release-of-matlab) | R2024a | The MATLAB release you want to install, in lower-case. For example: `R2019b`|
6161
| [MATLAB_PRODUCT_LIST](#build-an-image-with-a-specific-set-of-products) | MATLAB | Products to install as a space-separated list. For more information, see [MPM.md](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/MPM.md). For example: `MATLAB Simulink Deep_Learning_Toolbox Fixed-Point_Designer`|
62-
| [MATLAB_INSTALL_LOCATION](#build-an-image-with-matlab-installed-to-a-specific-location) | /opt/matlab/r2024a | The path to install MATLAB. |
62+
| [MATLAB_INSTALL_LOCATION](#build-an-image-with-matlab-installed-to-a-specific-location) | /opt/matlab/R2024a | The path to install MATLAB. |
6363
| [LICENSE_SERVER](#build-an-image-configured-to-use-a-license-server) | *unset* | The port and hostname of the machine that is running the Network License Manager, using the `port@hostname` syntax. For example: `27000@MyServerName` |
6464

6565
Use these arguments with the the `docker build` command to customize your image.
@@ -68,30 +68,30 @@ Alternatively, you can change the default values for these arguments directly in
6868
#### Build an Image for a Different Release of MATLAB
6969
For example, to build an image for MATLAB R2019b, use this command.
7070
```bash
71-
docker build --build-arg MATLAB_RELEASE=r2019b -t matlab:r2019b .
71+
docker build --build-arg MATLAB_RELEASE=R2019b -t matlab:R2019b .
7272
```
7373

7474
#### Build an Image with a specific set of products
7575
For example, to build an image with MATLAB and Simulink®, use this command.
7676
```bash
77-
docker build --build-arg MATLAB_PRODUCT_LIST='MATLAB Simulink' -t matlab:r2024a .
77+
docker build --build-arg MATLAB_PRODUCT_LIST='MATLAB Simulink' -t matlab:R2024a .
7878
```
7979

8080
#### Build an Image with MATLAB installed to a specific location
8181
For example, to build an image with MATLAB installed at /opt/matlab, use this command.
8282
```bash
83-
docker build --build-arg MATLAB_INSTALL_LOCATION='/opt/matlab' -t matlab:r2024a .
83+
docker build --build-arg MATLAB_INSTALL_LOCATION='/opt/matlab' -t matlab:R2024a .
8484
```
8585

8686
#### Build an Image Configured to Use a License Server
8787

8888
Including the license server information with the `docker build` command means you do not have to pass it when running the container.
8989
```bash
9090
# Build container with the License Server.
91-
docker build --build-arg LICENSE_SERVER=27000@MyServerName -t matlab:r2024a .
91+
docker build --build-arg LICENSE_SERVER=27000@MyServerName -t matlab:R2024a .
9292

9393
# Run the container, without needing to pass license information.
94-
docker run --init --rm matlab:r2024a -batch ver
94+
docker run --init --rm matlab:R2024a -batch ver
9595
```
9696

9797
## Use the Network License Manager
@@ -124,7 +124,7 @@ With the `docker build` command, either:
124124

125125
```bash
126126
# Example
127-
docker build -t matlab:r2024a --build-arg LICENSE_SERVER=27000@MyServerName .
127+
docker build -t matlab:R2024a --build-arg LICENSE_SERVER=27000@MyServerName .
128128
```
129129
- Use the `network.lic` file:
130130
1. Place the `network.lic` file in the same folder as the Dockerfile.
@@ -133,41 +133,41 @@ With the `docker build` command, either:
133133

134134
```bash
135135
# Example
136-
docker build -t matlab:r2024a .
136+
docker build -t matlab:R2024a .
137137
```
138138

139139
With the `docker run` command, use the `MLM_LICENSE_FILE` environment variable. For example:
140140

141141
```bash
142-
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:r2024a -batch ver
142+
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:R2024a -batch ver
143143
```
144144

145145
## Run the Container
146146
If you did not provide the license server information when building the image, then provide it when running the container. Set the environment variable `MLM_LICENSE_FILE` using the `-e` flag, with the network license manager's location in the format `port@hostname`.
147147
148148
```bash
149149
# Start MATLAB, print version information, and exit:
150-
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:r2024a -batch ver
150+
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab:R2024a -batch ver
151151
```
152152
153153
You can run the container **without** specifying `MLM_LICENSE_FILE` if you provided the license server information when building the image, as shown in the examples below.
154154
155155
### Run MATLAB in an Interactive Command Prompt
156156
To start the container and run MATLAB in an interactive command prompt, execute:
157157
```bash
158-
docker run --init -it --rm matlab:r2024a
158+
docker run --init -it --rm matlab:R2024a
159159
```
160160
### Run MATLAB in Batch Mode
161161
To start the container, run a MATLAB command, and then exit, execute:
162162
```bash
163163
# Container runs the command RAND in MATLAB and exits.
164-
docker run --init --rm matlab:r2024a -batch rand
164+
docker run --init --rm matlab:R2024a -batch rand
165165
```
166166
167167
### Run MATLAB with Startup Options
168168
To override the default behavior of the container and run MATLAB with any set of arguments, such as `-logfile`, execute:
169169
```bash
170-
docker run --init -it --rm matlab:r2024a -logfile "logfilename.log"
170+
docker run --init -it --rm matlab:R2024a -logfile "logfilename.log"
171171
```
172172
To learn more, see the documentation: [Commonly Used Startup Options](https://www.mathworks.com/help/matlab/matlab_env/commonly-used-startup-options.html).
173173

‎alternates/building-on-matlab-docker-image/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Copyright 2023-2024 The MathWorks, Inc.
22

33
# To specify which MATLAB release to install in the container, edit the value of the MATLAB_RELEASE argument.
4-
# Use lower case to specify the release, for example: ARG MATLAB_RELEASE=r2021b
5-
ARG MATLAB_RELEASE=r2024a
4+
# Use uppercase to specify the release, for example: ARG MATLAB_RELEASE=R2021b
5+
ARG MATLAB_RELEASE=R2024a
66

77
# Specify the extra products to install into the image. These products can either be toolboxes or support packages.
88
ARG ADDITIONAL_PRODUCTS="Symbolic_Math_Toolbox Deep_Learning_Toolbox_Model_for_ResNet-50_Network"

‎alternates/building-on-matlab-docker-image/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ cd matlab-dockerfile/alternates/building-on-matlab-docker-image
2525
### Quick start
2626
Build a container with a name and tag.
2727
```bash
28-
docker build -t matlab_with_add_ons:r2024a .
28+
docker build -t matlab_with_add_ons:R2024a .
2929
```
3030

3131
You can then run the container with the "batch" option. Test the container by running an example MATLAB command such as `ver` to display the installed toolboxes.
3232
```bash
33-
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab_with_add_ons:r2024a -batch ver
33+
docker run --init --rm -e MLM_LICENSE_FILE=27000@MyServerName matlab_with_add_ons:R2024a -batch ver
3434
```
3535
You can check the installed support packages using the MATLAB command `matlabshared.supportpkg.getInstalled`.
3636

3737
You can also run the container with the "browser" option to access MATLAB in a browser.
3838
```bash
39-
docker run --init --rm -it -p 8888:8888 matlab_with_add_ons:r2024a -browser
39+
docker run --init --rm -it -p 8888:8888 matlab_with_add_ons:R2024a -browser
4040
```
4141
For more information, see [Run the Container](#run-the-container).
4242

@@ -51,7 +51,7 @@ The `ADDITIONAL_PRODUCTS` argument must be a space separated list surrounded by
5151
By default, `ADDITIONAL_PRODUCTS` includes example products, which you can replace.
5252
For example, to build an image containing MATLAB and the Deep Learning Toolbox™:
5353
```bash
54-
docker build --build-arg ADDITIONAL_PRODUCTS="Deep_Learning_Toolbox" -t matlab_with_add_ons:r2024a .
54+
docker build --build-arg ADDITIONAL_PRODUCTS="Deep_Learning_Toolbox" -t matlab_with_add_ons:R2024a .
5555
```
5656

5757
For a successful build, include at least one product.
@@ -67,7 +67,7 @@ The [Dockerfile](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/ma
6767

6868
| Argument Name | Default value | Effect |
6969
|---|---|---|
70-
| [MATLAB_RELEASE](#build-an-image-for-a-different-release-of-matlab) | r2024a | The MATLAB release to install. Must be lower-case, for example: `r2020b`.|
70+
| [MATLAB_RELEASE](#build-an-image-for-a-different-release-of-matlab) | R2024a | The MATLAB release to install. Must be lower-case, for example: `R2020b`.|
7171
| [ADDITIONAL_PRODUCTS](#customize-products-to-install-using-matlab-package-manager-mpm) | "Symbolic_Math_Toolbox Deep_Learning_Toolbox_Model_for_ResNet-50_Network" | A space separated list of toolboxes and support packages to install. For more details, see [MATLAB Package Manager](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/MPM.md)|
7272
| [LICENSE_SERVER](#build-an-image-with-license-server-information) | *unset* | The port and hostname of a machine that is running a Network License Manager, using the `port@hostname` syntax. For example: `27000@MyServerName`. To use this build argument, the corresponding lines must be uncommented in the Dockerfile. |
7373

@@ -79,12 +79,12 @@ directly in the Dockerfile.
7979

8080
For example, to build an image for MATLAB R2022b, use the following command.
8181
```bash
82-
docker build --build-arg MATLAB_RELEASE=r2022b -t matlab_with_add_ons:r2022b .
82+
docker build --build-arg MATLAB_RELEASE=R2022b -t matlab_with_add_ons:R2022b .
8383
```
8484

8585
To build an image for MATLAB R2022b with Deep Learning Toolbox and Parallel Computing Toolbox™, use the following command.
8686
```bash
87-
docker build --build-arg MATLAB_RELEASE=r2022b --build-arg ADDITIONAL_PRODUCTS="Deep_Learning_Toolbox Parallel_Computing_Toolbox" -t matlab_with_add_ons:r2022b .
87+
docker build --build-arg MATLAB_RELEASE=R2022b --build-arg ADDITIONAL_PRODUCTS="Deep_Learning_Toolbox Parallel_Computing_Toolbox" -t matlab_with_add_ons:R2022b .
8888
```
8989
For supported releases see [MATLAB Container Image on Docker Hub](https://hub.docker.com/r/mathworks/matlab).
9090
### Build an Image with License Server Information
@@ -95,12 +95,12 @@ server or browser mode will not start successfully.
9595

9696
Build container with the License Server.
9797
```bash
98-
docker build -t matlab_with_add_ons:r2024a --build-arg LICENSE_SERVER=27000@MyServerName .
98+
docker build -t matlab_with_add_ons:R2024a --build-arg LICENSE_SERVER=27000@MyServerName .
9999
```
100100

101101
Run the container, without needing to pass license information.
102102
```bash
103-
docker run --init matlab_with_add_ons:r2024a -batch ver
103+
docker run --init matlab_with_add_ons:R2024a -batch ver
104104
```
105105
## Run the Container
106106
The Docker container you build using this Dockerfile inherits run options from its base image.

‎alternates/matlab-container-offline-install/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
# install, and the location at which to install MATLAB.
55

66
# Here is an example docker build command with the optional build arguments.
7-
# docker build --build-arg MATLAB_RELEASE=r2024a
7+
# docker build --build-arg MATLAB_RELEASE=R2024a
88
# --build-arg MATLAB_PRODUCT_LIST="MATLAB Deep_Learning_Toolbox Symbolic_Math_Toolbox"
99
# --build-arg MATLAB_INSTALL_LOCATION="/opt/matlab/R2024a"
1010
# -t my_matlab_image_name .
1111

1212
# To specify which MATLAB release to install in the container, edit the value of the MATLAB_RELEASE argument.
13-
# Use lowercase to specify the release, for example: ARG MATLAB_RELEASE=r2021b
14-
ARG MATLAB_RELEASE=r2024a
13+
# Use uppercase to specify the release, for example: ARG MATLAB_RELEASE=R2021b
14+
ARG MATLAB_RELEASE=R2024a
1515

1616
# Specify the list of products to install into MATLAB.
1717
ARG MATLAB_PRODUCT_LIST="MATLAB"

‎alternates/matlab-container-offline-install/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ You can then store the generated Docker build and copy it to the offline or air-
2626

2727
Build the archive image with a name and tag.
2828
```bash
29-
docker build -t mpm-archive:r2024a -f archive.Dockerfile .
29+
docker build -t mpm-archive:R2024a -f archive.Dockerfile .
3030
```
3131

3232
By default, the [archive.Dockerfile](archive.Dockerfile) downloads the latest available MATLAB release without any additional toolboxes or products.
@@ -41,7 +41,7 @@ To run this step in an offline or air-gapped environment, you need:
4141

4242
Build a container with a name and tag.
4343
```bash
44-
DOCKER_BUILDKIT=1 docker build -t matlab-from-source:r2024a .
44+
DOCKER_BUILDKIT=1 docker build -t matlab-from-source:R2024a .
4545
```
4646

4747
To customize the build of the product image, refer to [Customize the Product Docker Image](#customize-the-product-docker-image).
@@ -54,7 +54,7 @@ The [archive.Dockerfile](archive.Dockerfile) supports the following Docker build
5454

5555
| Argument Name | Default value | Effect |
5656
|---|---|---|
57-
| [MATLAB_RELEASE](#build-an-archive-image-for-a-different-release-of-matlab) | r2024a | The MATLAB release you want to install, in lower-case. For example: `r2022a` |
57+
| [MATLAB_RELEASE](#build-an-archive-image-for-a-different-release-of-matlab) | R2024a | The MATLAB release you want to install, in lower-case. For example: `R2022a` |
5858
| [MATLAB_PRODUCT_LIST](#build-an-archive-image-with-a-specific-set-of-products) | MATLAB | Products to install as a space-separated list. For more information, see [MPM.md](../../MPM.md). For example: `MATLAB Simulink Deep_Learning_Toolbox Fixed-Point_Designer` |
5959

6060
Use these arguments with the `docker build` command to customize your image.
@@ -64,25 +64,25 @@ Alternatively, you can change the default values for these arguments directly in
6464

6565
For example, to build an archive image for MATLAB R2023b installation files, use the following command.
6666
```bash
67-
docker build --build-arg MATLAB_RELEASE=r2023b -t mpm-archive:r2023b -f archive.Dockerfile .
67+
docker build --build-arg MATLAB_RELEASE=R2023b -t mpm-archive:R2023b -f archive.Dockerfile .
6868
```
6969

7070
#### Build an Archive Image with a specific set of products
7171

7272
For example, to build an image with MATLAB and the Statistics and Machine Learning Toolbox™ installation files, use this command.
7373
```bash
74-
docker build --build-arg MATLAB_PRODUCT_LIST="MATLAB Statistics_and_Machine_Learning_Toolbox" -t mpm-archive:r2024a -f archive.Dockerfile .
74+
docker build --build-arg MATLAB_PRODUCT_LIST="MATLAB Statistics_and_Machine_Learning_Toolbox" -t mpm-archive:R2024a -f archive.Dockerfile .
7575
```
7676

7777
### Customize the Product Docker Image
7878
The [Dockerfile](Dockerfile) supports the following Docker build-time variables:
7979

8080
| Argument Name | Default value | Effect |
8181
|---|---|---|
82-
| [MATLAB_RELEASE](#build-an-image-for-a-different-release-of-matlab) | r2024a | The MATLAB release you want to install, in lower-case. For example: `r2022a`. :warning: This release must match the `MATLAB_RELEASE` you use to build the archive image. |
82+
| [MATLAB_RELEASE](#build-an-image-for-a-different-release-of-matlab) | R2024a | The MATLAB release you want to install, in lower-case. For example: `R2022a`. :warning: This release must match the `MATLAB_RELEASE` you use to build the archive image. |
8383
| [MATLAB_PRODUCT_LIST](#build-an-image-with-a-specific-set-of-products) | MATLAB | Products to install as a space-separated list. For more information, see [MPM.md](../../MPM.md). For example: `MATLAB Simulink Deep_Learning_Toolbox Fixed-Point_Designer`. The list of products to install must be a subset of the installation files available in the archive image. |
84-
| [MATLAB_INSTALL_LOCATION](#build-an-image-with-matlab-installed-to-a-specific-location) | /opt/matlab/r2024a | The path to install MATLAB. |
85-
| [ARCHIVE_BASE_IMAGE](#build-an-image-from-a-different-archive) | mpm-archive:r2024a | The name of the Docker® image containing the product installation files. |
84+
| [MATLAB_INSTALL_LOCATION](#build-an-image-with-matlab-installed-to-a-specific-location) | /opt/matlab/R2024a | The path to install MATLAB. |
85+
| [ARCHIVE_BASE_IMAGE](#build-an-image-from-a-different-archive) | mpm-archive:R2024a | The name of the Docker® image containing the product installation files. |
8686
| [LICENSE_SERVER](#build-an-image-configured-to-use-a-license-server) | *unset* | The port and hostname of the machine that is running the Network License Manager, using the `port@hostname` syntax. For example: `27000@MyServerName` |
8787

8888
Use these arguments with the `docker build` command to customize your image.
@@ -93,40 +93,40 @@ Alternatively, you can change the default values for these arguments directly in
9393

9494
For example, to build an image for MATLAB R2023b, use the following command.
9595
```bash
96-
docker build --build-arg MATLAB_RELEASE=r2023b --build-arg ARCHIVE_BASE_IMAGE=mpm-archive:r2023b -t matlab-from-source:r2023b .
96+
docker build --build-arg MATLAB_RELEASE=R2023b --build-arg ARCHIVE_BASE_IMAGE=mpm-archive:R2023b -t matlab-from-source:R2023b .
9797
```
9898
Ensure that the release of the archive base image you set in `ARCHIVE_BASE_IMAGE` matches the one in `MATLAB_RELEASE`.
9999

100100
### Build an Image with a Specific Set of Products
101101

102102
For example, to build an image with MATLAB and the Statistics and Machine Learning Toolbox, use this command.
103103
```bash
104-
docker build --build-arg MATLAB_PRODUCT_LIST="MATLAB Statistics_and_Machine_Learning_Toolbox" -t matlab-stats-from-source:r2024a .
104+
docker build --build-arg MATLAB_PRODUCT_LIST="MATLAB Statistics_and_Machine_Learning_Toolbox" -t matlab-stats-from-source:R2024a .
105105
```
106106

107107
### Build an Image with MATLAB Installed to a Specific Location
108108

109109
For example, to build an image with MATLAB installed at `/opt/matlab`, use this command.
110110
```bash
111-
docker build --build-arg MATLAB_INSTALL_LOCATION="/opt/matlab" -t matlab-from-source:r2024a .
111+
docker build --build-arg MATLAB_INSTALL_LOCATION="/opt/matlab" -t matlab-from-source:R2024a .
112112
```
113113

114114
### Build an Image from a Different Archive
115115

116116
For example, to build an image using a different archive image, use the following command.
117117
```bash
118-
docker build --build-arg ARCHIVE_BASE_IMAGE=my-archive -t matlab-from-source:r2024a .
118+
docker build --build-arg ARCHIVE_BASE_IMAGE=my-archive -t matlab-from-source:R2024a .
119119
```
120120

121121
#### Build an Image Configured to Use a License Server
122122

123123
Including the license server information with the `docker build` command means you do not have to pass it when running the container.
124124
```bash
125125
# Build container with the License Server.
126-
docker build --build-arg LICENSE_SERVER=27000@MyServerName -t matlab-from-source:r2024a .
126+
docker build --build-arg LICENSE_SERVER=27000@MyServerName -t matlab-from-source:R2024a .
127127

128128
# Run the container, without needing to pass license information.
129-
docker run --init --rm matlab-from-source:r2024a -batch ver
129+
docker run --init --rm matlab-from-source:R2024a -batch ver
130130
```
131131

132132
For more information, see [Use the Network License Manager](../../README.md#use-the-network-license-manager).

‎alternates/matlab-container-offline-install/archive.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Copyright 2024 The MathWorks, Inc.
22

33
# Here is an example docker build command with the optional build arguments.
4-
# docker build --build-arg MATLAB_RELEASE=r2024a
4+
# docker build --build-arg MATLAB_RELEASE=R2024a
55
# --build-arg MATLAB_PRODUCT_LIST="MATLAB Deep_Learning_Toolbox Symbolic_Math_Toolbox"
66
# -f archive.Dockerfile
77
# -t mpm-archive .
88

99
# To specify which MATLAB release to install in the container, edit the value of the MATLAB_RELEASE argument.
10-
# Use lowercase to specify the release, for example: ARG MATLAB_RELEASE=r2021b
11-
ARG MATLAB_RELEASE=r2024a
10+
# Use uppercase to specify the release, for example: ARG MATLAB_RELEASE=R2021b
11+
ARG MATLAB_RELEASE=R2024a
1212

1313
# Specify the list of products to install into MATLAB.
1414
ARG MATLAB_PRODUCT_LIST="MATLAB"

‎alternates/non-interactive/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
# version of MATLAB, list of products to install, and the location at which to install MATLAB.
55

66
# Here is an example docker build command with the optional build arguments.
7-
# docker build --build-arg MATLAB_RELEASE=r2024a
7+
# docker build --build-arg MATLAB_RELEASE=R2024a
88
# --build-arg MATLAB_PRODUCT_LIST="MATLAB Deep_Learning_Toolbox Symbolic_Math_Toolbox"
99
# --build-arg MATLAB_INSTALL_LOCATION="/opt/matlab/R2024a"
1010
# -t my_matlab_image_name .
1111

1212
# To specify which MATLAB release to install in the container, edit the value of the MATLAB_RELEASE argument.
13-
# Use lowercase to specify the release, for example: ARG MATLAB_RELEASE=r2021b
14-
ARG MATLAB_RELEASE=r2024a
13+
# Use uppercase to specify the release, for example: ARG MATLAB_RELEASE=R2021b
14+
ARG MATLAB_RELEASE=R2024a
1515

1616
# Specify the list of products to install into MATLAB.
1717
ARG MATLAB_PRODUCT_LIST="MATLAB"

‎alternates/non-interactive/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ cd matlab-dockerfile/alternates/non-interactive
2626

2727
Build a container with a name and tag.
2828
```bash
29-
docker build -t matlab-non-interactive:r2024a .
29+
docker build -t matlab-non-interactive:R2024a .
3030
```
3131

3232
You can then run the container and use the `matlab-batch` command. Test the container by running an example MATLAB command such as `rand`.
3333
```bash
34-
docker run --init --rm matlab-non-interactive:r2024a matlab-batch -licenseToken "user@email.com|encodedToken" "rand"
34+
docker run --init --rm matlab-non-interactive:R2024a matlab-batch -licenseToken "user@email.com|encodedToken" "rand"
3535
```
3636
For more information, see [Run the Container](#run-the-container).
3737

@@ -46,9 +46,9 @@ The [Dockerfile](Dockerfile) supports the following Docker build-time variables:
4646

4747
| Argument Name | Default value | Effect |
4848
|---|---|---|
49-
| [MATLAB_RELEASE](#build-an-image-for-a-different-release-of-matlab) | r2024a | The MATLAB release you want to install, in lower-case. For example: `r2022a` |
49+
| [MATLAB_RELEASE](#build-an-image-for-a-different-release-of-matlab) | R2024a | The MATLAB release you want to install, in lower-case. For example: `R2022a` |
5050
| [MATLAB_PRODUCT_LIST](#build-an-image-with-a-specific-set-of-products) | MATLAB | Products to install as a space-separated list. For more information, see [MPM.md](../../MPM.md). For example: `MATLAB Simulink Deep_Learning_Toolbox Fixed-Point_Designer` |
51-
| [MATLAB_INSTALL_LOCATION](#build-an-image-with-matlab-installed-to-a-specific-location) | /opt/matlab/r2024a | The path to install MATLAB. |
51+
| [MATLAB_INSTALL_LOCATION](#build-an-image-with-matlab-installed-to-a-specific-location) | /opt/matlab/R2024a | The path to install MATLAB. |
5252

5353
Use these arguments with the `docker build` command to customize your image.
5454
Alternatively, the default values for these arguments can be changed directly in the [Dockerfile](Dockerfile).
@@ -57,7 +57,7 @@ Alternatively, the default values for these arguments can be changed directly in
5757

5858
For example, to build an image for MATLAB R2021b, use the following command.
5959
```bash
60-
docker build --build-arg MATLAB_RELEASE=r2021b -t matlab-non-interactive:r2021b .
60+
docker build --build-arg MATLAB_RELEASE=R2021b -t matlab-non-interactive:R2021b .
6161
```
6262

6363
For supported releases see [MATLAB Batch Licensing support](MATLAB-BATCH.md#limitations).
@@ -66,14 +66,14 @@ For supported releases see [MATLAB Batch Licensing support](MATLAB-BATCH.md#limi
6666

6767
For example, to build an image with MATLAB and the Statistics and Machine Learning Toolbox, use this command.
6868
```bash
69-
docker build --build-arg MATLAB_PRODUCT_LIST="MATLAB Statistics_and_Machine_Learning_Toolbox" -t matlab-stats-non-interactive:r2024a .
69+
docker build --build-arg MATLAB_PRODUCT_LIST="MATLAB Statistics_and_Machine_Learning_Toolbox" -t matlab-stats-non-interactive:R2024a .
7070
```
7171

7272
### Build an Image with MATLAB installed to a specific location
7373

7474
For example, to build an image with MATLAB installed at `/opt/matlab`, use this command.
7575
```bash
76-
docker build --build-arg MATLAB_INSTALL_LOCATION="/opt/matlab" -t matlab-non-interactive:r2024a .
76+
docker build --build-arg MATLAB_INSTALL_LOCATION="/opt/matlab" -t matlab-non-interactive:R2024a .
7777
```
7878

7979
## Use MATLAB Batch Licensing
@@ -86,22 +86,22 @@ With the `docker run` command, either:
8686
- Specify the `-licenseToken` run-arg.
8787
```bash
8888
# Example
89-
docker run --init --rm matlab-non-interactive:r2024a matlab-batch -licenseToken "user@email.com|encodedToken" "disp('Hello, World.')"
89+
docker run --init --rm matlab-non-interactive:R2024a matlab-batch -licenseToken "user@email.com|encodedToken" "disp('Hello, World.')"
9090
```
9191

9292
- Specify the `MLM_LICENSE_TOKEN` environment variable.
9393
```bash
9494
# Example
9595
export MLM_LICENSE_TOKEN="user@email.com|encodedToken"
96-
docker run --init --rm -e MLM_LICENSE_TOKEN matlab-non-interactive:r2024a matlab-batch "disp('Hello, World.')"
96+
docker run --init --rm -e MLM_LICENSE_TOKEN matlab-non-interactive:R2024a matlab-batch "disp('Hello, World.')"
9797
```
9898

9999
## Run the Container
100100
This Dockerfile's default entrypoint is a shell session. Once you start the container, use `matlab-batch` to start MATLAB with a MATLAB batch licensing token.
101101
102102
```bash
103103
# Launch MATLAB, print Hello, World., and exit:
104-
docker run --init --rm matlab-non-interactive:r2024a matlab-batch -licenseToken "user@email.com|encodedToken" "disp('Hello, World.')"
104+
docker run --init --rm matlab-non-interactive:R2024a matlab-batch -licenseToken "user@email.com|encodedToken" "disp('Hello, World.')"
105105
```
106106
107107
You can set your MATLAB batch licensing token at the container level by setting the `MLM_LICENSE_TOKEN` environment variable, as shown in the examples below.
@@ -111,15 +111,15 @@ To start the container, run a MATLAB command and exit, execute:
111111
```bash
112112
# Container runs the command RAND in MATLAB and exits.
113113
export MLM_LICENSE_TOKEN="user@email.com|encodedToken"
114-
docker run --init --rm -e MLM_LICENSE_TOKEN matlab-non-interactive:r2024a matlab-batch rand
114+
docker run --init --rm -e MLM_LICENSE_TOKEN matlab-non-interactive:R2024a matlab-batch rand
115115
```
116116
117117
### Run a MATLAB script
118118
To start the container, run a MATLAB script and exit, execute:
119119
```bash
120120
# Container runs the script myscript.m in MATLAB and exits.
121121
export MLM_LICENSE_TOKEN="user@email.com|encodedToken"
122-
docker run --init --rm -v $(pwd):/content -w /content -e MLM_LICENSE_TOKEN matlab-non-interactive:r2024a matlab-batch "myscript"
122+
docker run --init --rm -v $(pwd):/content -w /content -e MLM_LICENSE_TOKEN matlab-non-interactive:R2024a matlab-batch "myscript"
123123
```
124124
125125
## More MATLAB Docker Resources

‎tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To run the tests, set the following environment variables:
2020

2121
| Environment Variable | Example | Notes |
2222
| -------------------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23-
| `IMAGE_NAME` | `IMAGE_NAME=matlab-docker-image:r2020a` | The tests will run against the Docker image named `${IMAGE_NAME}`. If no such image is found, the tests will fail. |
23+
| `IMAGE_NAME` | `IMAGE_NAME=matlab-docker-image:R2020a` | The tests will run against the Docker image named `${IMAGE_NAME}`. If no such image is found, the tests will fail. |
2424
| `LICENSE_FILE_PATH` | `LICENSE_FILE_PATH=path/to/license.lic` | Some tests will attempt to run MATLAB® in the Docker container and require a license file. Store the path to the license file in `${LICENSE_FILE_PATH}` |
2525

2626
## Structure of the Tests
@@ -75,7 +75,7 @@ To run the tests:
7575
```
7676
3. Build the Docker image that you want to test.
7777
```bash
78-
docker build -t <your_image_name> --build-args MATLAB_RELASE=<r20xxx> .
78+
docker build -t <your_image_name> --build-args MATLAB_RELASE=<R20xxx> .
7979
```
8080
This operation might take a few minutes.
8181
4. Change current working folder to the tests folder.

‎tests/alternates/matlab-installer/test_failing_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def setUpClass(cls):
1919
# set a matlab release different from the one set in VersionInfo.xml (latest)
2020
# matlab_release should be a valid tag for the matlab-deps image.
2121
# E.g., matlab-deps:latest is valid, matlab-deps:r1999b is not
22-
cls.old_matlab_release = "r2019b"
22+
cls.old_matlab_release = "R2019b"
2323
cls.dockerfile_dirpath = str(
2424
Path(__file__).parents[3] / helpers.get_alternates_path()
2525
)

‎tests/utils/helpers.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def get_alternates_path():
3838

3939
def get_release_from_string(string):
4040
"""Get the release from a string"""
41-
match = re.search("r20[2-9][0-9][ab]", string, re.IGNORECASE)
41+
match = re.search("R20[2-9][0-9][ab]", string, re.IGNORECASE)
4242
if match:
4343
return match.group(0)
4444
else:
@@ -60,6 +60,7 @@ def remove_file(filepath):
6060
except OSError:
6161
pass
6262

63+
6364
def get_changelog_mb_version(filepath):
6465
"""Get the latest version of matlab-batch from a .md file"""
6566
## look for the vYYYY.MM.N pattern, where
@@ -69,18 +70,20 @@ def get_changelog_mb_version(filepath):
6970
pattern = "v(20[2-9][0-9]\.[0-9]{1,2}\.[0-9]+)"
7071
ver_regexp = re.compile(pattern)
7172

72-
headings_tree=mdparser.get_headings_tree(filepath)
73-
73+
headings_tree = mdparser.get_headings_tree(filepath)
74+
7475
target_heading = "Changelog"
7576
path_to_target = mdparser.find_element(headings_tree, target_heading)
7677
if not path_to_target:
77-
raise ValueError(f"Unable to find '{target_heading}' in the heading tree of {filepath}")
78-
78+
raise ValueError(
79+
f"Unable to find '{target_heading}' in the heading tree of {filepath}"
80+
)
81+
7982
version_list = mdparser.get_children(headings_tree, path_to_target)
8083
if not version_list:
8184
raise ValueError(f"The heading '{target_heading}' does not have sub-headings")
82-
83-
latest_version=version_list[0]
85+
86+
latest_version = version_list[0]
8487
match = ver_regexp.search(latest_version)
8588
if match is None:
8689
raise ValueError(

0 commit comments

Comments
 (0)
Please sign in to comment.