Skip to content

Commit

Permalink
feat: upgrade to Ubuntu 16.04
Browse files Browse the repository at this point in the history
  • Loading branch information
dorowu-qnap committed May 3, 2017
1 parent 4941a6f commit 8045c37
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 21 deletions.
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
FROM ubuntu:14.04
FROM ubuntu:16.04
MAINTAINER Doro Wu <[email protected]>

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

# built-in packages
RUN apt-get update \
&& apt-get install -y --force-yes --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" \
&& curl -SL http://download.opensuse.org/repositories/home:Horst3180/xUbuntu_16.04/Release.key | sudo apt-key add - \
&& apt-get install -y --no-install-recommends software-properties-common curl \
&& 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 | apt-key add - \
&& add-apt-repository ppa:fcwu-tw/ppa \
&& apt-get update \
&& apt-get install -y --force-yes --no-install-recommends \
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
supervisor \
openssh-server pwgen sudo vim-tiny \
net-tools \
Expand All @@ -26,6 +25,7 @@ RUN apt-get update \
python-pip python-dev build-essential \
mesa-utils libgl1-mesa-dri \
gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine pinta arc-theme \
dbus-x11 x11-utils \
&& apt-get autoclean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
Expand All @@ -41,4 +41,6 @@ RUN pip install setuptools wheel && pip install -r /usr/lib/web/requirements.txt

EXPOSE 80
WORKDIR /root
ENV HOME=/home/ubuntu \
SHELL=/bin/bash
ENTRYPOINT ["/startup.sh"]
32 changes: 28 additions & 4 deletions image/etc/supervisor/conf.d/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,40 @@ redirect_stderr=true

[program:lxsession]
priority=15
directory=/home/ubuntu
command=/usr/bin/lxsession
directory=/root
command=/usr/bin/openbox
user=root
autostart=true
autorestart=true
stopsignal=QUIT
environment=DISPLAY=":1",HOME="/home/ubuntu"
stdout_logfile=/var/log/lxsession.log
environment=DISPLAY=":1",HOME="/root",USER="root"
stdout_logfile=/var/log/openbox.log
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]
priority=20
directory=/
Expand Down
2 changes: 1 addition & 1 deletion image/home/ubuntu/.gtkrc-2.0 → image/root/.gtkrc-2.0
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"
include "/home/ubuntu/.gtkrc-2.0.mine"
include "/root/.gtkrc-2.0.mine"
13 changes: 4 additions & 9 deletions image/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@

mkdir -p /var/run/sshd

# create an ubuntu user
# PASS=`pwgen -c -n -1 10`
PASS=ubuntu
# 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/"
chown -R root:root /root
mkdir -p /root/.config/pcmanfm/LXDE/
cp /usr/share/doro-lxde-wallpapers/desktop-items-0.conf /root/.config/pcmanfm/LXDE/

if [ -n "$VNC_PASSWORD" ]; then
echo -n "$VNC_PASSWORD" > /.password1
x11vnc -storepasswd $(cat /.password1) /.password2
chmod 400 /.password*
sed -i 's/^command=x11vnc.*/& -rfbauth \/.password2/' /etc/supervisor/conf.d/supervisord.conf
export VNC_PASSWORD=
fi

cd /usr/lib/web && ./run.py > /var/log/web.log 2>&1 &
Expand Down
2 changes: 1 addition & 1 deletion image/usr/lib/web/lightop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def redirectme():
# check all running
for i in xrange(20):
output = subprocess.check_output(r"supervisorctl status | grep RUNNING | wc -l", shell=True)
if output.strip() == "4":
if output.strip() == "6":
FIRST = False
return HTML_REDIRECT
time.sleep(2)
Expand Down

0 comments on commit 8045c37

Please sign in to comment.