From 8679c4ff8b6aacf027bf9f6703d23b2402d95360 Mon Sep 17 00:00:00 2001 From: L-ING Date: Mon, 27 May 2024 13:33:17 +0800 Subject: [PATCH 1/2] feat: install novnc from apk --- Dockerfile | 39 +++++++++++++++------------------------ README.md | 6 ++++-- supervisord.conf | 3 +-- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index a918194..988dc43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,26 @@ FROM alpine:edge RUN \ - # Install required packages - echo "http://dl-3.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \ - apk --update --upgrade add \ - bash \ - fluxbox \ - git \ - supervisor \ - xvfb \ - x11vnc \ - && \ - # Install noVNC - git clone --depth 1 https://github.com/novnc/noVNC.git /root/noVNC && \ - git clone --depth 1 https://github.com/novnc/websockify /root/noVNC/utils/websockify && \ - rm -rf /root/noVNC/.git && \ - rm -rf /root/noVNC/utils/websockify/.git && \ - apk del git && \ - sed -i -- "s/ps -p/ps -o pid | grep/g" /root/noVNC/utils/launch.sh + # Install required packages + echo "http://dl-3.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories &&\ + apk --update --upgrade add --no-cache \ + fluxbox \ + supervisor \ + xvfb \ + x11vnc \ + novnc COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf EXPOSE 8080 # Setup environment variables ENV HOME=/root \ - DEBIAN_FRONTEND=noninteractive \ - LANG=en_US.UTF-8 \ - LANGUAGE=en_US.UTF-8 \ - LC_ALL=C.UTF-8 \ - DISPLAY=:0.0 \ - DISPLAY_WIDTH=1024 \ - DISPLAY_HEIGHT=768 + DEBIAN_FRONTEND=noninteractive \ + LANG=en_US.UTF-8 \ + LANGUAGE=en_US.UTF-8 \ + LC_ALL=C.UTF-8 \ + DISPLAY=:0.0 \ + DISPLAY_WIDTH=1024 \ + DISPLAY_HEIGHT=768 CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] \ No newline at end of file diff --git a/README.md b/README.md index 2fb0936..5f78816 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ $ docker build -t mynovnc . $ docker run -it --rm -p 8080:8080 mynovnc ``` -Open the browser http://localhost:8080. +Open the browser http://localhost:8080/vnc.html. Click 'Connect'. -Then you can see xterm. \ No newline at end of file +Then you can see xterm. + +Or open http://localhost:8080/vnc_lite.html. \ No newline at end of file diff --git a/supervisord.conf b/supervisord.conf index 9188c3c..f582242 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -10,10 +10,9 @@ command=/usr/bin/x11vnc autorestart=true [program:novnc] -command=/root/noVNC/utils/launch.sh --vnc localhost:5900 --listen 8080 +command=novnc_server --vnc localhost:5900 --listen 8080 autorestart=true [program:fluxbox] command=fluxbox autorestart=true - From 64b6f2ef0443cc0850c0ae90ad0ccef29c6fbf3d Mon Sep 17 00:00:00 2001 From: L-ING Date: Mon, 27 May 2024 19:20:22 +0800 Subject: [PATCH 2/2] docs: instruction for OpenGL on CPU-only host --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 5f78816..980a8f5 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,12 @@ RUN \ echo 'autorestart=true' >> supervisord.conf ``` +# With OpenGL +To support OpenGL on a CPU-only host, add this package: +```Dockerfile +RUN apk add --no-cache mesa-dri-gallium +``` + Build and run the image. ```bash