Skip to content

Instantly share code, notes, and snippets.

@arunoruto
Created January 20, 2026 01:13
Show Gist options
  • Select an option

  • Save arunoruto/7fe39cac10dbe1ca47b72a15d60353c0 to your computer and use it in GitHub Desktop.

Select an option

Save arunoruto/7fe39cac10dbe1ca47b72a15d60353c0 to your computer and use it in GitHub Desktop.
Matlab Distrobox
RELEASE=R2025b
LICENSE_FILE=./network.lic
PRODUCTS=(
"Symbolic_Math_Toolbox"
"Parallel_Computing_Toolbox"
)
#!/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 ==="
#!/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
#!/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