Open arunoruto opened 2 hours ago
Hi @arunoruto ,
Thank you for your message. When running in -vnc
(or -shell
) mode, the mathworks/matlab
Docker container starts a bash shell process, which immediately stops (hence causing the Docker container to stop) if stdin
is not open
.
To fix the issue you can add the stdin_open: true
field to the compose file that you are using. For example:
services:
matlab:
image: mathworks/matlab:r2024b
container_name: matlab
restart: unless-stopped
init: true
stdin_open: true
command: -vnc
shm_size: 512M
environment:
MLM_LICENSE_FILE: /network.lic
volumes:
- ./network.lic:/network.lic
ports:
- 5901:5901 # vnc
- 6080:6080 # web browser connection
Also, the init: true
flag is not required in this case.
For more documentation regarding the mathworks/matlab
Docker images, please refer to the mathworks-ref-arch/container-images repository and our page on DockerHub.
I was trying to start a matlab container using docker compose and it was working for the browser version:
But when I try running a VNC session, it just keeps restarting with no obvious error logs! My VNC compose file:
And the logs:
Note, I inserted the
init: true
, since all thedocker run
commands have--init
flag.