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