Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Get Matlab interactive running #16

Open
wants to merge 5 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion matlab-interactive/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ USER root

RUN sed -i 's/--vnc/--listen 8888 --vnc/' /bin/run.sh \
&& sed -i 's@localhost:5901 > /dev/null 2>&1@localhost:5901@' /bin/run.sh \
&& sed -i 's@-localhost no > /dev/null 2>&1@-localhost no@' /bin/run.sh \
&& groupadd -g 1337 istio \
&& cp -r /home/matlab /tmp_home && chown -R matlab:matlab /tmp_home \
&& mkdir -p /home/jovyan && chown -R matlab:matlab /home/jovyan \
&& usermod -d /home/jovyan matlab && chown matlab:matlab /opt/noVNC/index.html
&& usermod -d /home/jovyan matlab && chown matlab:matlab /opt/noVNC/

COPY --chown=matlab:matlab entrypoint.sh /
COPY --chown=matlab:matlab redirect.html /opt/noVNC/redirect.html

USER matlab

Expand Down
14 changes: 14 additions & 0 deletions matlab-interactive/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
#!/bin/bash
cp -r /tmp_home/. /home/jovyan

mkdir -p /opt/noVNC`dirname ${NB_PREFIX}`
ln -s /opt/noVNC /opt/noVNC${NB_PREFIX}

cat > ~/.config/xfce4/xinitrc <<EOF
#!/bin/sh
xset s off
xset s noblank
. /etc/xdg/xfce4/xinitrc
EOF

echo "matlab" | vncpasswd -f > ~/.vnc/passwd
chmod 0600 ~/.vnc/passwd

exec /bin/run.sh "$@"
1 change: 1 addition & 0 deletions matlab-interactive/redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><script>window.location.href = window.location.href.split("/").slice(0,-1).join("/") + "/vnc.html?password=matlab&autoconnect=true&resize=remote&host=" + window.location.host + "&port=443&path=" + window.location.href.split("/").slice(3,-1).join("/") + "/websockify"</script></html>