Docker container to run compiled Matlab executable in Windows 10

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?

Answers (1)

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 Comments

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.
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.

Sign in to comment.

Categories

Products

Release

R2019a

Asked:

on 31 Jul 2020

Commented:

on 12 Jul 2024

Community Treasure Hunt

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

Start Hunting!