install simulink on docker images

조회 수: 21 (최근 30일)
Adrien
Adrien 2023년 11월 16일
답변: Swastik Sarkar 2024년 10월 23일
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
Adrien
Adrien 2023년 11월 19일
편집: Adrien 2023년 11월 19일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Swastik Sarkar
Swastik Sarkar 2024년 10월 23일
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.

카테고리

Help CenterFile Exchange에서 Containers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by