install simulink on docker images
22 views (last 30 days)
Show older comments
Hi,
I recently pull matlab images from docker Hub in my VM. I can access it on my browser and everything seems to work good. But, I don't have simulink installed so I can't open my microgrid structure. How can I install simulink ? I don't have access to add on on my page. So I would like to download the add on file of simulink but I don't manage to find it. !
Thanks !
4 Comments
Answers (1)
Swastik Sarkar
on 23 Oct 2024
To install Simulink into the mathworks/matlab Docker images using mpm, the following Dockerfile can be utilized. This Dockerfile was created based on available documentation while retaining the original base image:
ARG MATLAB_RELEASE="R2024b"
FROM mathworks/matlab:${MATLAB_RELEASE}
ARG MATLAB_RELEASE
ARG MATLAB_PRODUCT_LIST="MATLAB Simulink"
ARG MATLAB_INSTALL_LOCATION="/opt/matlab/${MATLAB_RELEASE}"
USER root
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt update \
&& apt-get install --no-install-recommends --yes \
wget \
ca-certificates \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
USER matlab
WORKDIR /home/matlab
RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm \
&& chmod +x mpm \
&& sudo HOME=${HOME} ./mpm install \
--release=${MATLAB_RELEASE} \
--destination=${MATLAB_INSTALL_LOCATION} \
--products ${MATLAB_PRODUCT_LIST} \
|| (echo "MPM Installation Failure. See below for more information:" && cat /tmp/mathworks_root.log && false) \
&& sudo rm -rf mpm /tmp/mathworks_root.log \
&& sudo ln -s ${MATLAB_INSTALL_LOCATION}/bin/matlab /usr/bin/matlab
To customize the installation, adjust the MATLAB_PRODUCT_LIST to include the desired products. Build the Docker image and run it in browser mode using the following commands:
$ docker build -t matlab . # Execute in the same directory as Dockerfile
$ docker run -it --rm -p 8888:8888 --shm-size=512M matlab -browser
Upon navigating to localhost:8888, Simulink will appear in the toolstrip as depicted in the accompanying image:
Hope this helps.
0 Comments
See Also
Categories
Find more on Containers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!