initial commit
This commit is contained in:
commit
4df2637ff5
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -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"]
|
23
start
Normal file
23
start
Normal file
@ -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
|
3
supervisor-sshd.conf
Normal file
3
supervisor-sshd.conf
Normal file
@ -0,0 +1,3 @@
|
||||
[program:sshd]
|
||||
command=/usr/sbin/sshd -D
|
||||
autorestart=true
|
4
supervisor-vncd.conf
Normal file
4
supervisor-vncd.conf
Normal file
@ -0,0 +1,4 @@
|
||||
[program:vncd]
|
||||
command=bash -c 'USER=%(ENV__IMG_USERNAME)s vncserver -geometry 1280x800 :0'
|
||||
autorestart=false
|
||||
directory=/home/dave
|
2
supervisord.conf
Normal file
2
supervisord.conf
Normal file
@ -0,0 +1,2 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
Loading…
Reference in New Issue
Block a user