feat: add noVNC

This commit is contained in:
DCsunset 2020-02-02 03:58:03 -08:00
parent 4a9ec88641
commit ec883e62ab
3 changed files with 64 additions and 28 deletions

View file

@ -3,15 +3,40 @@ ARG VERSION
FROM ubuntu:${VERSION:-latest}
LABEL MAINTAINER="DCsunset"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq xfce4 xfce4-goodies \
ENV noVNC_version=1.1.0
ENV websockify_version=0.9.0
# Local debug
#COPY ./sources.list /etc/apt/
#COPY ./websockify-${websockify_version}.tar.gz /websockify.tar.gz
#COPY ./noVNC-${noVNC_version}.tar.gz /noVNC.tar.gz
# Install apps
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq xfce4 xfce4-goodies \
tigervnc-standalone-server \
chromium-browser vim
chromium-browser vim \
python3-numpy python3-setuptools \
&& rm -rf /var/lib/apt/lists/*
# Install noVNC
RUN wget https://github.com/novnc/websockify/archive/v${websockify_version}.tar.gz -O /websockify.tar.gz \
tar -xvf /websockify.tar.gz -C / \
&& cd /websockify-${websockify_version} \
&& python3 setup.py install \
&& cd / && rm -r /websockify.tar.gz /websockify-${websockify_version} \
&& wget https://github.com/novnc/noVNC/archive/v${noVNC_version}.tar.gz -O /noVNC.tar.gz \
&& tar -xvf /noVNC.tar.gz -C / \
&& cd /noVNC-${noVNC_version} \
&& ln -s vnc.html index.html \
&& rm /noVNC.tar.gz
COPY ./config/helpers.rc /root/.config/xfce4/
COPY ./config/chromium-WebBrowser.desktop /root/.local/share/xfce4/helpers/
COPY ./start.sh /
EXPOSE 5900 80
WORKDIR /root
EXPOSE 5900 6080
CMD [ "/start.sh" ]

View file

@ -16,6 +16,7 @@ it is **insecure** when exposing the container on the Internet.
## Exposed ports
* 5900: Used for VNC interface
* 6080: Used for noVNC Web UI
## Installed applications
@ -27,29 +28,6 @@ only the following applications are installed by default:
* Vim
* Chromium browser
## Fonts
If non-latin characters are not displayed well,
install the font packs based on your needs.
To install the Indian font pack:
```
sudo apt-get install fonts-indic
```
To install the CJK font pack:
```
sudo apt-get install fonts-noto-cjk
```
To install the international font pack:
```
sudo apt-get install fonts-noto
```
## Build
To use the latest Ubuntu image:
@ -63,3 +41,33 @@ Or specify a version:
```
docker build --build-arg VERSION=18.04 -t ubuntu-vnc .
```
## FAQ
### Fonts
If non-latin characters are not displayed well,
install the font packs based on your needs.
To install the Indian font pack:
```
apt-get install fonts-indic
```
To install the CJK font pack:
```
apt-get install fonts-noto-cjk
```
To install the international font pack:
```
apt-get install fonts-noto
```
### Scaling
By default, noVNC's scaling mode is set to None.
It can be changed in the noVNC panel easily.

View file

@ -4,11 +4,14 @@ umask 0077 # use safe default permissions
mkdir -p "$HOME/.vnc" # create config directory
chmod go-rwx "$HOME/.vnc" # enforce safe permissions
# Start TigerVNC
if [ ! -z $VNC_PASSWD ]; then
vncpasswd -f <<< "$VNC_PASSWD" > "$HOME/.vnc/passwd"
vncserver -fg -localhost no :0
else
vncpasswd -f <<< "" > "$HOME/.vnc/passwd"
vncserver -fg --I-KNOW-THIS-IS-INSECURE -SecurityTypes None -localhost no :0
vncserver --I-KNOW-THIS-IS-INSECURE -SecurityTypes None -localhost no :0
fi
# Start noVNC
/noVNC-${noVNC_version}/utils/launch.sh