install simulink on docker images

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 comentarios

Michael
Michael el 17 de Nov. de 2023
Hi Adrien,
The image on dockerhub does indeed only have MATLAB installed on it, but we have an example of how to build a new image with any additional toolboxes and support packages included here: matlab-dockerfile/alternates/building-on-matlab-docker-image at main · mathworks-ref-arch/matlab-dockerfile · GitHub
Hopefully this will help you out,
Michael
Adrien
Adrien el 17 de Nov. de 2023
Editada: Adrien el 17 de Nov. de 2023
Thanks !! I tried to build the image with the following command : docker build --build-arg ADDITIONAL_PRODUCTS="simulink" -t matlab_with_toolboxes:r2023b .
I have the following error
Error: Unable to find installation candidates for these products: simulink
Edit : ok it was Simulink
Adrien
Adrien el 19 de Nov. de 2023
Editada: Adrien el 19 de Nov. de 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.

Iniciar sesión para comentar.

Respuestas (1)

Swastik Sarkar
Swastik Sarkar el 23 de Oct. de 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.

Categorías

Más información sobre Installing Products en Centro de ayuda y File Exchange.

Preguntada:

el 16 de Nov. de 2023

Respondida:

el 23 de Oct. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by