From 483f3e475856db10772b41b54a9ac3b62fac26dd Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 24 Jul 2018 17:22:46 -0400 Subject: [PATCH] A basic working desktop that is browser/cloud accessible Signed-off-by: Vincent Batts --- Dockerfile | 20 ++++++++++++++++++++ default-vncconfig | 9 +++++++++ default-vncpasswd | 1 + default-vncxstartup | 10 ++++++++++ entrypoint.sh | 19 +++++++++++++++++++ 5 files changed, 59 insertions(+) create mode 100644 Dockerfile create mode 100644 default-vncconfig create mode 100644 default-vncpasswd create mode 100644 default-vncxstartup create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8d69d20 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM fedora:latest +RUN dnf update -y --refresh && \ + dnf install -y @xfce-desktop firefox thunderbird && \ + dnf install -y tigervnc-server novnc net-tools git python-numpy && \ + dnf clean all && \ + git clone https://github.com/kanaka/websockify /usr/bin/websockify && \ + adduser -m -u 1000 limited +RUN echo -n limited | passwd --stdin limited +COPY default-vncpasswd / +COPY default-vncxstartup / +COPY default-vncconfig / +ENV PREFERRED="startxfce4" +ENV HOME=/home/limited +RUN chown -R limited /home/limited +USER limited +WORKDIR /home/limited +VOLUME ["/home/limited"] +EXPOSE 5900 6080 +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT bash /entrypoint.sh diff --git a/default-vncconfig b/default-vncconfig new file mode 100644 index 0000000..d67d45d --- /dev/null +++ b/default-vncconfig @@ -0,0 +1,9 @@ +## Supported server options to pass to vncserver upon invocation can be listed +## in this file. See the following manpages for more: vncserver(1) Xvnc(1). +## Several common ones are shown below. Uncomment and modify to your liking. +## +# securitytypes=vncauth,tlsvnc +# desktop=sandbox +# geometry=2000x1200 +# localhost +# alwaysshared diff --git a/default-vncpasswd b/default-vncpasswd new file mode 100644 index 0000000..5c789b4 --- /dev/null +++ b/default-vncpasswd @@ -0,0 +1 @@ +pKя: \ No newline at end of file diff --git a/default-vncxstartup b/default-vncxstartup new file mode 100644 index 0000000..8c1acf6 --- /dev/null +++ b/default-vncxstartup @@ -0,0 +1,10 @@ +#!/bin/sh + +unset SESSION_MANAGER +unset DBUS_SESSION_BUS_ADDRESS +. /etc/X11/xinit/xinitrc-common +if [ -n "$PREFERRED" ] ; then + exec "$PREFERRED" +else + exec startxfce4 +fi diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..ff5fcb1 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +mkdir -p $HOME/.vnc +if [ ! -f "$HOME/.vnc/passwd" ] ; then + cp -av /default-vncpasswd $HOME/.vnc/passwd + chmod 0600 $HOME/.vnc/passwd +fi +if [ ! -f "$HOME/.vnc/config" ] ; then + cp -av /default-vncconfig $HOME/.vnc/config +fi +if [ ! -f "$HOME/.vnc/xstartup" ] ; then + cp -av /default-vncxstartup $HOME/.vnc/xstartup + chmod +x $HOME/.vnc/xstartup +fi + +vncserver :0 -name limited-desktop +novnc_server ${1:"$@"}