Skip to content

Instantly share code, notes, and snippets.

@llandsmeer
Created October 17, 2022 14:48
Show Gist options
  • Save llandsmeer/31ce2a84a01f9fce522e0aa94fd90379 to your computer and use it in GitHub Desktop.
Save llandsmeer/31ce2a84a01f9fce522e0aa94fd90379 to your computer and use it in GitHub Desktop.
Arbor GUI in the browser via noVNC
# docker build -t arbor-gui . && docker run -it -p 5999:5999 arbor-gui
# then visit http://localhost:5999/vnc.html?host=localhost&port=5999&autoconnect=true
FROM ubuntu:latest
EXPOSE 5999
ENV DEBIAN_FRONTEND=noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
ENV TZ=Europe/Amsterdam
RUN apt-get update && apt-get install -y xvfb x11vnc wget novnc git wmctrl
WORKDIR /app
RUN wget https://github.com/arbor-sim/gui/releases/download/nightly-tag-2022-07-31/arbor-gui.AppImage
RUN chmod +x ./arbor-gui.AppImage && ./arbor-gui.AppImage --appimage-extract
RUN git clone --depth 1 'https://github.com/novnc/noVNC/'
RUN echo ' \n\
(sleep 5; echo VISIT "http://localhost:5999/vnc.html?host=localhost&port=5999&autoconnect=true") & \n\
# Xvfb :1 -screen 0 1024x768x16 & \n\
Xvfb :1 -screen 0 1920x1080x16 & \n\
/usr/bin/x11vnc -display :1.0 -nopw & \n\
export DISPLAY=":1" \n\
(cd /app/noVNC ; \n\
bash utils/novnc_proxy --vnc localhost:5900 --listen 5999 & \n\
) \n\
cp /app/squashfs-root/ /tmp/tmp.FF5mk4P3bh -r # what the actual \n\
cd /app/squashfs-root \n\
DISPLAY=":1" ./AppRun \n\
' >> /app/start.sh
RUN chmod +x /app/start.sh
RUN xdg-user-dirs-update
CMD "/app/start.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment