Docker Mounted Volume not Writable
9 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!