Docker Mounted Volume not Writable

9 ビュー (過去 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 Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by