Docker container to run compiled Matlab executable in Windows 10

18 vues (au cours des 30 derniers jours)
George Corliss
George Corliss le 31 Juil 2020
Commenté : Sok Ming Jamie le 12 Juil 2024
I want to run a compiled Matlab executable inside a Docker container under Windows 10. I can copy the appropriate Matlab runtime and point to it. When I execute inside the container, after a short pause, I get a fresh command prompt, but no output, warning, or error. Perhaps some Java piece is not configured correctly?

Réponses (1)

George Corliss
George Corliss le 2 Août 2020
Duh. I need to INSTALL the desired MATLAB runtime in the Docker image, not just copy the necessary files. I adapted from https://www.mathworks.com/matlabcentral/answers/438576-open-exe-file-with-docker
Dockerfile:
# docker build --no-cache --tag testing --force .
# docker run testing hello
# Line 1: Use dotnet-framework base image
FROM microsoft/dotnet-framework
# Previously downloaded and unzipped installer:
COPY ["/MATLAB_Runtime_R2019a_Update_8_win64", "/MATLAB_Runtime_win64"]
# Several programs I may wish to execute:
COPY /bin .
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# Takes about 10 minutes to install:
RUN Start-Process C:\MATLAB_Runtime_win64\setup.exe -ArgumentList '-mode silent', '-agreeToLicense yes' -Wait
# Line 6: Installation folder after setup is complete
RUN Remove-Item -Force -Recurse C:\\MATLAB_Runtime_win64
Works like a charm!
  2 commentaires
jeremy engelbrecht
jeremy engelbrecht le 17 Sep 2020
HI George
Sorry to bother but when you did the install, did it create a MATLAB directory in your program files folder in your container. reason I am asking is that it seems it is not installing the runtime in my container.
Sok Ming Jamie
Sok Ming Jamie le 12 Juil 2024
Hi Jeremy,
did you manage to resolve the installation issue? I, too, am unable to install the runtime in my container and I'm hoping you might be able to share the fix. I'm using Windows servercore:ltsc2019 base image, with MATLAB runtime r2020b.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by