install simulink on docker images

29 vues (au cours des 30 derniers jours)
Adrien
Adrien le 16 Nov 2023
Réponse apportée : Swastik Sarkar le 23 Oct 2024 à 8:50
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 commentaires
Adrien
Adrien le 19 Nov 2023
Modifié(e) : Adrien le 19 Nov 2023
Another question, now I have simulink inside my matlab container but when I tried to import or create a project nothing happened... Do you have an idea of what is the problem ? Thanks a lot
Edit : okay seems like a licence issue :
Diagnostic Information:
Feature: MATLAB
License path:
Licensing error: 4402,0.
I use a trial version.. It is permitted ? I can't connect to the matlab interface anymore.

Connectez-vous pour commenter.

Réponses (1)

Swastik Sarkar
Swastik Sarkar le 23 Oct 2024 à 8:50
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.

Catégories

En savoir plus sur Containers dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by