commit 4df2637ff5495f8496ae55de77b2043c4e5c6b0e Author: dave Date: Tue Jul 5 11:58:52 2016 -0700 initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..20dd0f3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu:trusty + +ENV _IMG_USERNAME=admin _IMG_PASSWORD=admin + +RUN locale-gen en_US && \ + apt-get update && \ + apt-get install -y icewm icewm-themes xterm openssh-server supervisor && \ + apt-get install -y tightvncserver && \ + mkdir /var/run/sshd + +ADD start /start + +EXPOSE 22 +EXPOSE 5900 + +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY supervisor-sshd.conf /etc/supervisor/conf.d/sshd.conf +#COPY supervisor-vncd.conf /etc/supervisor/conf.d/vncd.conf + +ENTRYPOINT ["/start"] diff --git a/start b/start new file mode 100644 index 0000000..7e9ac04 --- /dev/null +++ b/start @@ -0,0 +1,23 @@ +#!/bin/sh + +trap 'kill $(jobs -p)' EXIT + +useradd --create-home --groups sudo $_IMG_USERNAME + +echo "$_IMG_USERNAME:$_IMG_PASSWORD" | chpasswd + +su -c "mkdir -p /home/${_IMG_USERNAME}/.vnc" $_IMG_USERNAME + +su -c "echo '${_IMG_PASSWORD}' | vncpasswd -f > /home/${_IMG_USERNAME}/.vnc/passwd" ${_IMG_USERNAME} +chmod 700 /home/${_IMG_USERNAME}/.vnc +chmod 600 /home/${_IMG_USERNAME}/.vnc/passwd +#echo "user=${_IMG_USERNAME}" >> /etc/supervisor/conf.d/vncd.conf +#echo 'environment=HOME="'$_IMG_USERNAME'"' >> /etc/supervisor/conf.d/vncd.conf + +su -c "vncserver -geometry 1280x800 :0" $_IMG_USERNAME + +if [ -x "/home/${_IMG_USERNAME}/.setup.sh" ] ; then + /home/${_IMG_USERNAME}/.setup.sh & +fi + +supervisord diff --git a/supervisor-sshd.conf b/supervisor-sshd.conf new file mode 100644 index 0000000..161e1c8 --- /dev/null +++ b/supervisor-sshd.conf @@ -0,0 +1,3 @@ +[program:sshd] +command=/usr/sbin/sshd -D +autorestart=true diff --git a/supervisor-vncd.conf b/supervisor-vncd.conf new file mode 100644 index 0000000..1d5d0bc --- /dev/null +++ b/supervisor-vncd.conf @@ -0,0 +1,4 @@ +[program:vncd] +command=bash -c 'USER=%(ENV__IMG_USERNAME)s vncserver -geometry 1280x800 :0' +autorestart=false +directory=/home/dave diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..54296b8 --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,2 @@ +[supervisord] +nodaemon=true