mirror of
https://github.com/fcwu/docker-ubuntu-vnc-desktop
synced 2025-12-06 08:22:31 +01:00
init
This commit is contained in:
commit
6ce9dc1525
3 changed files with 96 additions and 0 deletions
38
Dockerfile
Normal file
38
Dockerfile
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
FROM ubuntu:12.04
|
||||
MAINTAINER Doro Wu <fcwu.tw@gmail.com>
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV HTTP_PROXY http://172.17.42.1:3134
|
||||
|
||||
# setup our Ubuntu sources (ADD breaks caching)
|
||||
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise main\n\
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse\n\
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ precise universe\n\
|
||||
deb http://us.archive.ubuntu.com/ubuntu/ precise restricted\n\
|
||||
"> /etc/apt/sources.list
|
||||
|
||||
# no Upstart or DBus
|
||||
# https://github.com/dotcloud/docker/issues/1724#issuecomment-26294856
|
||||
RUN apt-mark hold initscripts udev plymouth mountall
|
||||
RUN dpkg-divert --local --rename --add /sbin/initctl && ln -s /bin/true /sbin/initctl
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
# install our "base" environment
|
||||
RUN apt-get install -y --no-install-recommends openssh-server pwgen sudo vim-tiny
|
||||
RUN apt-get install -y --no-install-recommends lxde
|
||||
RUN apt-get install -y --no-install-recommends x11vnc xvfb
|
||||
RUN apt-get install -y supervisor
|
||||
RUN apt-get install -y libreoffice
|
||||
RUN apt-get install -y firefox
|
||||
|
||||
ADD startup.sh /
|
||||
ADD supervisord.conf /
|
||||
|
||||
# clean up after ourselves
|
||||
RUN apt-get clean
|
||||
|
||||
EXPOSE 5900
|
||||
EXPOSE 22
|
||||
WORKDIR /
|
||||
ENTRYPOINT ["/startup.sh"]
|
||||
12
startup.sh
Executable file
12
startup.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir /var/run/sshd
|
||||
|
||||
# create an ubuntu user
|
||||
PASS=`pwgen -c -n -1 10`
|
||||
PASS=ubuntu
|
||||
echo "User: ubuntu Pass: $PASS"
|
||||
useradd --create-home --shell /bin/bash --user-group --groups adm,sudo ubuntu
|
||||
echo "ubuntu:$PASS" | chpasswd
|
||||
|
||||
exec /usr/bin/supervisord -c /supervisord.conf -n
|
||||
46
supervisord.conf
Normal file
46
supervisord.conf
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
[supervisord]
|
||||
nodaemon=false
|
||||
|
||||
[program:ssh]
|
||||
priority=10
|
||||
directory=/
|
||||
command=/usr/sbin/sshd -D
|
||||
user=root
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stopsignal=QUIT
|
||||
|
||||
[program:xvfb]
|
||||
priority=10
|
||||
directory=/
|
||||
command=/usr/bin/Xvfb :1 -screen 0 1024x768x16
|
||||
user=root
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stopsignal=QUIT
|
||||
stdout_logfile=/var/log/xvfb.log
|
||||
stderr_logfile=/var/log/xvfb.err
|
||||
|
||||
[program:lxsession]
|
||||
priority=15
|
||||
directory=/home/ubuntu
|
||||
command=/usr/bin/lxsession
|
||||
user=ubuntu
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stopsignal=QUIT
|
||||
environment=DISPLAY=":1"
|
||||
stdout_logfile=/var/log/lxsession.log
|
||||
stderr_logfile=/var/log/lxsession.err
|
||||
|
||||
[program:x11vnc]
|
||||
priority=20
|
||||
directory=/
|
||||
command=x11vnc -display :1 -xkb
|
||||
#command=x11vnc -display :1 -listen localhost -xkb
|
||||
user=root
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stopsignal=QUIT
|
||||
stdout_logfile=/var/log/x11vnc.log
|
||||
stderr_logfile=/var/log/x11vnc.err
|
||||
Loading…
Reference in a new issue