-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
87 lines (72 loc) · 2.1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM ubuntu:20.04
# prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# update dependencies
RUN apt update
RUN apt upgrade -y
# install xfce desktop
RUN apt install -y xfce4 xfce4-goodies
# install dependencies
RUN apt install -y \
tightvncserver \
novnc \
net-tools \
nano \
vim \
neovim \
curl \
wget \
firefox \
git \
python3 \
python3-pip
# xfce fixes
RUN update-alternatives --set x-terminal-emulator /usr/bin/xfce4-terminal.wrapper
# setup Chromium
RUN git clone https://github.com/scheib/chromium-latest-linux.git /chromium
RUN /chromium/update.sh
# VNC and noVNC config
ARG USER=root
ENV USER=${USER}
ARG VNCPORT=5900
ENV VNCPORT=${VNCPORT}
EXPOSE ${VNCPORT}
ARG NOVNCPORT=9090
ENV NOVNCPORT=${NOVNCPORT}
EXPOSE ${NOVNCPORT}
ARG VNCPWD=changeme
ENV VNCPWD=${VNCPWD}
ARG VNCDISPLAY=1920x1080
ENV VNCDISPLAY=${VNCDISPLAY}
ARG VNCDEPTH=16
ENV VNCDEPTH=${VNCDEPTH}
# setup VNC
RUN mkdir -p /root/.vnc/
RUN echo ${VNCPWD} | vncpasswd -f > /root/.vnc/passwd
RUN chmod 600 /root/.vnc/passwd
RUN echo "#!/bin/sh \n\
xrdb $HOME/.Xresources \n\
xsetroot -solid grey \n\
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & \n\
#x-window-manager & \n\
# Fix to make GNOME work \n\
export XKL_XMODMAP_DISABLE=1 \n\
/etc/X11/Xsession \n\
startxfce4 & \n\
" > /root/.vnc/xstartup
RUN chmod +x /root/.vnc/xstartup
# setup noVNC
RUN openssl req -new -x509 -days 365 -nodes \
-subj "/C=US/ST=IL/L=Springfield/O=OpenSource/CN=localhost" \
-out /etc/ssl/certs/novnc_cert.pem -keyout /etc/ssl/private/novnc_key.pem \
> /dev/null 2>&1
RUN cat /etc/ssl/certs/novnc_cert.pem /etc/ssl/private/novnc_key.pem \
> /etc/ssl/private/novnc_combined.pem
RUN chmod 600 /etc/ssl/private/novnc_combined.pem
ENTRYPOINT [ "/bin/bash", "-c", " \
echo 'NoVNC Certificate Fingerprint:'; \
openssl x509 -in /etc/ssl/certs/novnc_cert.pem -noout -fingerprint -sha256; \
vncserver :0 -rfbport ${VNCPORT} -geometry $VNCDISPLAY -depth $VNCDEPTH -localhost; \
/usr/share/novnc/utils/launch.sh --listen $NOVNCPORT --vnc localhost:$VNCPORT \
--cert /etc/ssl/private/novnc_combined.pem \
" ]