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: install novnc from apk #2

Open
wants to merge 2 commits into
base: master
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
39 changes: 15 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,21 @@ 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
$ 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.
Then you can see xterm.

Or open http://localhost:8080/vnc_lite.html.
3 changes: 1 addition & 2 deletions supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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