-
-
Save arunoruto/7fe39cac10dbe1ca47b72a15d60353c0 to your computer and use it in GitHub Desktop.
Matlab Distrobox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RELEASE=R2025b | |
| LICENSE_FILE=./network.lic | |
| PRODUCTS=( | |
| "Symbolic_Math_Toolbox" | |
| "Parallel_Computing_Toolbox" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| source .env | |
| # wget -O Dockerfile \ | |
| # https://raw.githubusercontent.com/mathworks-ref-arch/matlab-dockerfile/refs/heads/main/Dockerfile | |
| # Load variables from Nix config | |
| PRODUCTS=$(printf " %s" "${PRODUCTS[@]}") | |
| NAME="matlab:${RELEASE}-custom" | |
| echo "=== Building MATLAB $RELEASE Custom Image ===" | |
| echo "Toolboxes:${PRODUCTS}" | |
| # We use Podman (which you enabled in the previous module) | |
| podman build \ | |
| --no-cache \ | |
| --build-arg MATLAB_RELEASE="$RELEASE" \ | |
| --build-arg MATLAB_PRODUCT_LIST="MATLAB${PRODUCTS}" \ | |
| -t $NAME \ | |
| -f Dockerfile \ | |
| . | |
| echo "=== Build Complete: $NAME ===" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| source .env | |
| BOX_NAME=matlab-$RELEASE | |
| IMAGE=localhost/matlab:$RELEASE-custom | |
| distrobox create \ | |
| --name "$BOX_NAME" \ | |
| --image "$IMAGE" \ | |
| --volume "$LICENSE_FILE":/licenses/network.lic \ | |
| --yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| source .env | |
| BOX_NAME=matlab-$RELEASE | |
| distrobox enter "$BOX_NAME" -- /usr/bin/env MLM_LICENSE_FILE=/licenses/network.lic matlab "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment