From 514e6bd04282bf17b3343b5843916029a130c43f Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Thu, 14 Feb 2019 11:51:00 +0200 Subject: [PATCH] moved to ubuntu18 --- Dockerfile | 10 +++++----- README.md | 9 +++------ build-run | 9 --------- userinit.sh.template | 25 ------------------------- 4 files changed, 8 insertions(+), 45 deletions(-) diff --git a/Dockerfile b/Dockerfile index 159470c..2642a5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ -FROM ubuntu:16.04 +FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ - apt-get install -y --allow-unauthenticated vim openssh-server mc \ - less mercurial wget boxes firefox chromium-browser sudo netcat \ - lxde vnc4server net-tools terminator lxappearance figlet && apt-get clean + apt-get install -y --allow-unauthenticated vim openssh-server mc \ + less mercurial fiurefox chromium-browser git wget curl boxes sudo netcat \ + net-tools terminator default-jdk figlet python3-dev && apt-get clean && \ + curl https://bootstrap.pypa.io/get-pip.py | python3 RUN hg clone https://bitbucket.org/MoonQ/tools /usr/local/share/q-tools RUN echo X11UseLocalhost no >> /etc/ssh/sshd_config ADD bootstuff.sh / ADD userinit.sh / -ADD vnc_passwd / RUN /userinit.sh diff --git a/README.md b/README.md index 2ddbede..ef4ff29 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,14 @@ # Sandbox X environment in Docker -This setup creates a VNC server running LXDE with two browsers installed +This setup creates a ssh server with two browsers installed (chromium and firefox). The executable connects to the container with SSH. Once SSH session exits, -the container is destroyed. The executable automatically starts `vncviewer` -after starting the container if --vnc passed. +the container is destroyed. Run the `build-run` script to build and run the container. Following arguments may be passed: -* `--vnc` Starts vncviewer -* `--geometry` Default geometry for VNC server, e.g. `1024x768` * `--new-passwd` Generates a new random `vnc_passwd` file used - for authenticating the VNC client. + for authentication. diff --git a/build-run b/build-run index 4663d0c..3847840 100755 --- a/build-run +++ b/build-run @@ -35,7 +35,6 @@ for (( i=1; i<=$#; i++ )); do } done set -e -[[ -f vnc_passwd ]] || pwgen [[ -f .id_rsa.pub ]] || rsagen [[ -f .id_rsa ]] || rsagen @@ -76,14 +75,6 @@ while :; do ssh-keyscan $IP && break done -[[ "$VNC" -eq 1 ]] && { - ssh -i .id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $USER@$IP /home/$USER/bin/vncs "$VNCSIZE" - while :; do - wget -qO- ${IP}:5900 && break - sleep 5 - done - vncviewer -passwd vnc_passwd ${IP}:5900 &> /dev/null & -} ssh -i .id_rsa -XY -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $USER@$IP #&& break echo "Shutting down $nname" sleep 1 diff --git a/userinit.sh.template b/userinit.sh.template index bbccfaf..31398ce 100755 --- a/userinit.sh.template +++ b/userinit.sh.template @@ -12,31 +12,6 @@ echo '--PUBKEY--' > /home/$USR/.ssh/authorized_keys chmod 700 /home/$USR/.ssh chmod 600 /home/$USR/.ssh/authorized_keys chsh -s /bin/bash $USR -cp /vnc_passwd /home/$USR/.vnc/passwd -chmod 600 /home/$USR/.vnc/passwd -echo '#!/bin/sh -[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup -[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources - -xsetroot -solid grey -vncconfig -iconic & -terminator & -openbox & -lxpanel -p LXDE & -pcmanfm --desktop --profile LXDE & -/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 * -' > /home/$USR/.vnc/xstartup - -echo "#!/bin/bash - -vncserver :0 -depth 24 \$1 \ - -geometry 1680x1050 \ - -geometry 800x600 \ - -geometry 1024x768 \ - -geometry 1280x1024 \ - -geometry 1600x1200 \ - -geometry 1280x720 -" > /home/$USR/bin/vncs echo "#!/bin/bash