Docker Mounted Volume not Writable

8 次查看(过去 30 天)
Stephen Dame
Stephen Dame 2022-2-15
回答: Ninad 2024-1-18
When running Matlab/Simulink from a m-file script in a docker container the Matlab wrapper environment seems to prevent writing to the mounted file system. Is there a command line option (from MathWorks) that enables that?

回答(1 个)

Ninad
Ninad 2024-1-18
Hi Stephen,
As per my understanding, you are attempting to run MATLAB/Simulink using a script within a Docker container and facing issues while writing to the host's mounted filesystem from within the container, and you wish to enable the MATLAB environment within the Docker container to write to the mounted volume, which is a directory on the host machine that has been made accessible to the container.
You can use a prebuilt MATLAB container image available on Docker Hub (https://hub.docker.com/r/mathworks/matlab).
Refer this MATLAB Documentation to access MATLAB using pre-built MATLAB container image: https://in.mathworks.com/help/cloudcenter/ug/matlab-container-on-docker-hub.html
To share data with a container, you can mount folders in the host system to the container using the "-v" Docker option.
For example, the following option mounts the source folder "MyFolder" and its subfolders to a target folder in the container, "ContainerFolder"
-v /MyFolderPath/MyFolder:/home/matlab/Documents/MATLAB/ContainerFolder
Add this option when you execute the "docker run" command.
For more information on sharing data with containers, please see the following MATLAB documentation: https://in.mathworks.com/help/cloudcenter/ug/share-data-with-containers.html
Hope this helps.
Regards,
Ninad

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by