moved to ubuntu18
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
FROM ubuntu:16.04
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --allow-unauthenticated vim openssh-server mc \
|
apt-get install -y --allow-unauthenticated vim openssh-server mc \
|
||||||
less mercurial wget boxes firefox chromium-browser sudo netcat \
|
less mercurial fiurefox chromium-browser git wget curl boxes sudo netcat \
|
||||||
lxde vnc4server net-tools terminator lxappearance figlet && apt-get clean
|
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 hg clone https://bitbucket.org/MoonQ/tools /usr/local/share/q-tools
|
||||||
RUN echo X11UseLocalhost no >> /etc/ssh/sshd_config
|
RUN echo X11UseLocalhost no >> /etc/ssh/sshd_config
|
||||||
|
|
||||||
ADD bootstuff.sh /
|
ADD bootstuff.sh /
|
||||||
ADD userinit.sh /
|
ADD userinit.sh /
|
||||||
ADD vnc_passwd /
|
|
||||||
RUN /userinit.sh
|
RUN /userinit.sh
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
# Sandbox X environment in Docker
|
# 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).
|
(chromium and firefox).
|
||||||
The executable connects to the container with SSH. Once SSH session exits,
|
The executable connects to the container with SSH. Once SSH session exits,
|
||||||
the container is destroyed. The executable automatically starts `vncviewer`
|
the container is destroyed.
|
||||||
after starting the container if --vnc passed.
|
|
||||||
|
|
||||||
Run the `build-run` script to build and run the container.
|
Run the `build-run` script to build and run the container.
|
||||||
Following arguments may be passed:
|
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
|
* `--new-passwd` Generates a new random `vnc_passwd` file used
|
||||||
for authenticating the VNC client.
|
for authentication.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ for (( i=1; i<=$#; i++ )); do
|
|||||||
}
|
}
|
||||||
done
|
done
|
||||||
set -e
|
set -e
|
||||||
[[ -f vnc_passwd ]] || pwgen
|
|
||||||
[[ -f .id_rsa.pub ]] || rsagen
|
[[ -f .id_rsa.pub ]] || rsagen
|
||||||
[[ -f .id_rsa ]] || rsagen
|
[[ -f .id_rsa ]] || rsagen
|
||||||
|
|
||||||
@@ -76,14 +75,6 @@ while :; do
|
|||||||
ssh-keyscan $IP && break
|
ssh-keyscan $IP && break
|
||||||
done
|
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
|
ssh -i .id_rsa -XY -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $USER@$IP #&& break
|
||||||
echo "Shutting down $nname"
|
echo "Shutting down $nname"
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|||||||
@@ -12,31 +12,6 @@ echo '--PUBKEY--' > /home/$USR/.ssh/authorized_keys
|
|||||||
chmod 700 /home/$USR/.ssh
|
chmod 700 /home/$USR/.ssh
|
||||||
chmod 600 /home/$USR/.ssh/authorized_keys
|
chmod 600 /home/$USR/.ssh/authorized_keys
|
||||||
chsh -s /bin/bash $USR
|
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
|
echo "#!/bin/bash
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user