mirror of
https://github.com/fcwu/docker-ubuntu-vnc-desktop
synced 2025-12-06 16:32:47 +01:00
feat: upgrade to Ubuntu 16.04
This commit is contained in:
parent
4941a6f6c7
commit
8045c3720c
5 changed files with 42 additions and 21 deletions
14
Dockerfile
14
Dockerfile
|
|
@ -1,19 +1,18 @@
|
||||||
FROM ubuntu:14.04
|
FROM ubuntu:16.04
|
||||||
MAINTAINER Doro Wu <fcwu.tw@gmail.com>
|
MAINTAINER Doro Wu <fcwu.tw@gmail.com>
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
ENV HOME /home/ubuntu
|
|
||||||
|
|
||||||
RUN sed -i 's#http://archive.ubuntu.com/#http://tw.archive.ubuntu.com/#' /etc/apt/sources.list
|
RUN sed -i 's#http://archive.ubuntu.com/#http://tw.archive.ubuntu.com/#' /etc/apt/sources.list
|
||||||
|
|
||||||
# built-in packages
|
# built-in packages
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --force-yes --no-install-recommends software-properties-common curl \
|
&& apt-get install -y --no-install-recommends software-properties-common curl \
|
||||||
&& sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /' >> /etc/apt/sources.list.d/arc-theme.list" \
|
&& sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /' >> /etc/apt/sources.list.d/arc-theme.list" \
|
||||||
&& curl -SL http://download.opensuse.org/repositories/home:Horst3180/xUbuntu_16.04/Release.key | sudo apt-key add - \
|
&& curl -SL http://download.opensuse.org/repositories/home:Horst3180/xUbuntu_16.04/Release.key | apt-key add - \
|
||||||
&& add-apt-repository ppa:fcwu-tw/ppa \
|
&& add-apt-repository ppa:fcwu-tw/ppa \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y --force-yes --no-install-recommends \
|
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
|
||||||
supervisor \
|
supervisor \
|
||||||
openssh-server pwgen sudo vim-tiny \
|
openssh-server pwgen sudo vim-tiny \
|
||||||
net-tools \
|
net-tools \
|
||||||
|
|
@ -26,6 +25,7 @@ RUN apt-get update \
|
||||||
python-pip python-dev build-essential \
|
python-pip python-dev build-essential \
|
||||||
mesa-utils libgl1-mesa-dri \
|
mesa-utils libgl1-mesa-dri \
|
||||||
gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine pinta arc-theme \
|
gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine pinta arc-theme \
|
||||||
|
dbus-x11 x11-utils \
|
||||||
&& apt-get autoclean \
|
&& apt-get autoclean \
|
||||||
&& apt-get autoremove \
|
&& apt-get autoremove \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
@ -41,4 +41,6 @@ RUN pip install setuptools wheel && pip install -r /usr/lib/web/requirements.txt
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
|
ENV HOME=/home/ubuntu \
|
||||||
|
SHELL=/bin/bash
|
||||||
ENTRYPOINT ["/startup.sh"]
|
ENTRYPOINT ["/startup.sh"]
|
||||||
|
|
|
||||||
|
|
@ -11,16 +11,40 @@ redirect_stderr=true
|
||||||
|
|
||||||
[program:lxsession]
|
[program:lxsession]
|
||||||
priority=15
|
priority=15
|
||||||
directory=/home/ubuntu
|
directory=/root
|
||||||
command=/usr/bin/lxsession
|
command=/usr/bin/openbox
|
||||||
user=root
|
user=root
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
stopsignal=QUIT
|
stopsignal=QUIT
|
||||||
environment=DISPLAY=":1",HOME="/home/ubuntu"
|
environment=DISPLAY=":1",HOME="/root",USER="root"
|
||||||
stdout_logfile=/var/log/lxsession.log
|
stdout_logfile=/var/log/openbox.log
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
|
|
||||||
|
[program:lxpanel]
|
||||||
|
priority=15
|
||||||
|
directory=/root
|
||||||
|
command=/usr/bin/lxpanel --profile LXDE
|
||||||
|
user=root
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
stopsignal=QUIT
|
||||||
|
environment=DISPLAY=":1",HOME="/root",USER="root"
|
||||||
|
stdout_logfile=/var/log/lxpanel.log
|
||||||
|
redirect_stderr=true
|
||||||
|
|
||||||
|
[program:pcmanfm]
|
||||||
|
priority=15
|
||||||
|
directory=/root
|
||||||
|
command=/usr/bin/pcmanfm --desktop --profile LXDE
|
||||||
|
user=root
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
stopsignal=QUIT
|
||||||
|
environment=DISPLAY=":1",HOME="/root",USER="root"
|
||||||
|
stdout_logfile=/var/log/pcmanfm.log
|
||||||
|
|
||||||
|
|
||||||
[program:x11vnc]
|
[program:x11vnc]
|
||||||
priority=20
|
priority=20
|
||||||
directory=/
|
directory=/
|
||||||
|
|
|
||||||
|
|
@ -17,4 +17,4 @@ gtk-xft-antialias=1
|
||||||
gtk-xft-hinting=1
|
gtk-xft-hinting=1
|
||||||
gtk-xft-hintstyle="hintslight"
|
gtk-xft-hintstyle="hintslight"
|
||||||
gtk-xft-rgba="rgb"
|
gtk-xft-rgba="rgb"
|
||||||
include "/home/ubuntu/.gtkrc-2.0.mine"
|
include "/root/.gtkrc-2.0.mine"
|
||||||
|
|
@ -2,21 +2,16 @@
|
||||||
|
|
||||||
mkdir -p /var/run/sshd
|
mkdir -p /var/run/sshd
|
||||||
|
|
||||||
# create an ubuntu user
|
chown -R root:root /root
|
||||||
# PASS=`pwgen -c -n -1 10`
|
mkdir -p /root/.config/pcmanfm/LXDE/
|
||||||
PASS=ubuntu
|
cp /usr/share/doro-lxde-wallpapers/desktop-items-0.conf /root/.config/pcmanfm/LXDE/
|
||||||
# echo "Username: ubuntu Password: $PASS"
|
|
||||||
id -u ubuntu &>/dev/null || useradd --create-home --shell /bin/bash --user-group --groups adm,sudo ubuntu
|
|
||||||
echo "ubuntu:$PASS" | chpasswd
|
|
||||||
chown -R ubuntu:ubuntu /home/ubuntu
|
|
||||||
sudo -u ubuntu -i bash -c "mkdir -p /home/ubuntu/.config/pcmanfm/LXDE/ \
|
|
||||||
&& cp /usr/share/doro-lxde-wallpapers/desktop-items-0.conf /home/ubuntu/.config/pcmanfm/LXDE/"
|
|
||||||
|
|
||||||
if [ -n "$VNC_PASSWORD" ]; then
|
if [ -n "$VNC_PASSWORD" ]; then
|
||||||
echo -n "$VNC_PASSWORD" > /.password1
|
echo -n "$VNC_PASSWORD" > /.password1
|
||||||
x11vnc -storepasswd $(cat /.password1) /.password2
|
x11vnc -storepasswd $(cat /.password1) /.password2
|
||||||
chmod 400 /.password*
|
chmod 400 /.password*
|
||||||
sed -i 's/^command=x11vnc.*/& -rfbauth \/.password2/' /etc/supervisor/conf.d/supervisord.conf
|
sed -i 's/^command=x11vnc.*/& -rfbauth \/.password2/' /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
export VNC_PASSWORD=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /usr/lib/web && ./run.py > /var/log/web.log 2>&1 &
|
cd /usr/lib/web && ./run.py > /var/log/web.log 2>&1 &
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ def redirectme():
|
||||||
# check all running
|
# check all running
|
||||||
for i in xrange(20):
|
for i in xrange(20):
|
||||||
output = subprocess.check_output(r"supervisorctl status | grep RUNNING | wc -l", shell=True)
|
output = subprocess.check_output(r"supervisorctl status | grep RUNNING | wc -l", shell=True)
|
||||||
if output.strip() == "4":
|
if output.strip() == "6":
|
||||||
FIRST = False
|
FIRST = False
|
||||||
return HTML_REDIRECT
|
return HTML_REDIRECT
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue