[smuxi] Docker: build docker images for the release and daily APT repository



commit 4bab491402a64d88b3fe736eb7229ecf4a478a6d
Author: Carlos Hernandez <carlos techbyte ca>
Date:   Wed Sep 24 20:26:55 2014 +0200

    Docker: build docker images for the release and daily APT repository

 docker/daily/Dockerfile   |   56 +++++++++++++++++++++++++++++++++++++++++++++
 docker/daily/creds.conf   |    2 +
 docker/daily/start.sh     |   19 +++++++++++++++
 docker/release/Dockerfile |   54 +++++++++++++++++++++++++++++++++++++++++++
 docker/release/creds.conf |    2 +
 docker/release/start.sh   |   19 +++++++++++++++
 6 files changed, 152 insertions(+), 0 deletions(-)
---
diff --git a/docker/daily/Dockerfile b/docker/daily/Dockerfile
new file mode 100644
index 0000000..93ce8eb
--- /dev/null
+++ b/docker/daily/Dockerfile
@@ -0,0 +1,56 @@
+# Docker scripts for Smuxi
+#
+# Copyright (C) 2014 Carlos Hernandez <carlos techbyte ca>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+# Builds a docker image for smuxi
+FROM ubuntu:trusty
+MAINTAINER Carlos Hernandez <carlos techbyte ca>
+
+# Let the container know that there is no tty
+ENV DEBIAN_FRONTEND noninteractive
+
+# Set user nobody to uid and gid of unRAID
+RUN usermod -u 99 nobody
+RUN usermod -g 100 nobody
+
+# Set locale
+ENV LANGUAGE en_US.UTF-8
+ENV LANG en_US.UTF-8
+RUN locale-gen en_US en_US.UTF-8
+RUN update-locale LANG=en_US.UTF-8
+RUN dpkg-reconfigure locales
+
+# Update Ubuntu
+RUN echo "deb http://ppa.launchpad.net/meebey/smuxi-daily/ubuntu trusty main" >> /etc/apt/sources.list
+RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5C39B6F9FC6D77D5
+RUN apt-get -q update
+RUN apt-mark hold initscripts udev plymouth mountall
+RUN apt-get -qy --force-yes dist-upgrade
+
+# Install smuxi from apt
+RUN usermod -m -d /config nobody
+RUN apt-get install -qy --force-yes smuxi-engine
+
+ADD ./start.sh /start.sh
+ADD ./creds.conf /creds.conf
+RUN chmod a+x  /start.sh
+
+VOLUME /config
+
+# DON'T RUN AS ROOT
+USER nobody
+ENTRYPOINT ["/start.sh"]
diff --git a/docker/daily/creds.conf b/docker/daily/creds.conf
new file mode 100644
index 0000000..c16c951
--- /dev/null
+++ b/docker/daily/creds.conf
@@ -0,0 +1,2 @@
+user   username
+pass   password
diff --git a/docker/daily/start.sh b/docker/daily/start.sh
new file mode 100644
index 0000000..be2c392
--- /dev/null
+++ b/docker/daily/start.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+if [ ! -e /config/creds.conf ]; then
+  cp /creds.conf /config/
+  chown nobody:users /config/creds.conf
+  chmod 755 /config/creds.conf
+fi
+
+user=`grep -E '^user\s' /config/creds.conf  | cut -f 2`
+pass=`grep -E '^pass\s' /config/creds.conf  | cut -f 2`
+
+if smuxi-server --list-users | grep -Fxq "$user"
+  then
+  echo "User already exists."
+else
+  smuxi-server --add-user --username=$user --password=$pass
+fi
+
+smuxi-server
diff --git a/docker/release/Dockerfile b/docker/release/Dockerfile
new file mode 100644
index 0000000..2632215
--- /dev/null
+++ b/docker/release/Dockerfile
@@ -0,0 +1,54 @@
+# Docker scripts for Smuxi
+#
+# Copyright (C) 2014 Carlos Hernandez <carlos techbyte ca>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+# Builds a docker image for smuxi
+FROM ubuntu:trusty
+MAINTAINER Carlos Hernandez <carlos techbyte ca>
+
+# Let the container know that there is no tty
+ENV DEBIAN_FRONTEND noninteractive
+
+# Set user nobody to uid and gid of unRAID
+RUN usermod -u 99 nobody
+RUN usermod -g 100 nobody
+
+# Set locale
+ENV LANGUAGE en_US.UTF-8
+ENV LANG en_US.UTF-8
+RUN locale-gen en_US en_US.UTF-8
+RUN update-locale LANG=en_US.UTF-8
+RUN dpkg-reconfigure locales
+
+# Update Ubuntu
+RUN apt-get -q update
+RUN apt-mark hold initscripts udev plymouth mountall
+RUN apt-get -qy --force-yes dist-upgrade
+
+# Install smuxi from apt
+RUN usermod -m -d /config nobody
+RUN apt-get install -qy --force-yes smuxi-engine
+
+ADD ./start.sh /start.sh
+ADD ./creds.conf /creds.conf
+RUN chmod a+x  /start.sh
+
+VOLUME /config
+
+# DON'T RUN AS ROOT
+USER nobody
+ENTRYPOINT ["/start.sh"]
diff --git a/docker/release/creds.conf b/docker/release/creds.conf
new file mode 100644
index 0000000..c16c951
--- /dev/null
+++ b/docker/release/creds.conf
@@ -0,0 +1,2 @@
+user   username
+pass   password
diff --git a/docker/release/start.sh b/docker/release/start.sh
new file mode 100644
index 0000000..be2c392
--- /dev/null
+++ b/docker/release/start.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+if [ ! -e /config/creds.conf ]; then
+  cp /creds.conf /config/
+  chown nobody:users /config/creds.conf
+  chmod 755 /config/creds.conf
+fi
+
+user=`grep -E '^user\s' /config/creds.conf  | cut -f 2`
+pass=`grep -E '^pass\s' /config/creds.conf  | cut -f 2`
+
+if smuxi-server --list-users | grep -Fxq "$user"
+  then
+  echo "User already exists."
+else
+  smuxi-server --add-user --username=$user --password=$pass
+fi
+
+smuxi-server


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]