Cleanups, write log files of sonarr and mysql to host

This commit is contained in:
2015-12-31 13:39:36 +01:00
parent 257625ad72
commit d4381991e1
31 changed files with 49 additions and 53 deletions

View File

@@ -1,20 +1,20 @@
export LC_ALL=C export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
apt_get_install='apt-get install -y --no-install-recommends' apt_install='apt-get install -y --no-install-recommends'
apt_get_install_permanent() { apt_install_permanent() {
echo $@ >> /build/permanent echo $@ >> /build/permanent
$apt_get_install "$@" $apt_install "$@"
} }
apt_get_install_temporary() { apt_install_temporary() {
echo $@ >> /build/temporary echo $@ >> /build/temporary
$apt_get_install "$@" $apt_install "$@"
} }
apt_remove() { apt_remove() {
apt-get -y --purge autoremove apt-get autoremove -y --purge "$@"
} }
export_env() { export_env() {
@@ -25,7 +25,3 @@ export_env() {
import_env() { import_env() {
export $1=`cat /etc/container_environment/$1` export $1=`cat /etc/container_environment/$1`
} }
add_host() {
echo "echo \"\$${1^^}_PORT_3306_TCP_ADDR $1\" >> /tmp/hosts" >> /opt/init.d/*_hosts
}

View File

@@ -6,4 +6,4 @@ if [ ! -d $MYSQL_DATA ]; then
cp /var/lib/mysql/ $MYSQL_DATA -R cp /var/lib/mysql/ $MYSQL_DATA -R
chown mysql:mysql $MYSQL_DATA -R chown mysql:mysql $MYSQL_DATA -R
fi fi
/usr/bin/mysqld_safe --skip-syslog /usr/bin/mysqld_safe --skip-syslog > /host/var/log/mysql/daemon.log

View File

@@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
set -e set -e
mono /opt/NzbDrone/NzbDrone.exe --no-browser -data=$SONARR_DATA mono /opt/NzbDrone/NzbDrone.exe --no-browser -data=$SONARR_DATA > /dev/null

View File

@@ -11,7 +11,7 @@ export_env AUTOMYSQLBACKUP_CONFIG /etc/automysqlbackup/automysqlbackup.conf
export_env AUTOMYSQLBACKUP_DATA /host/var/backup/db export_env AUTOMYSQLBACKUP_DATA /host/var/backup/db
## AutoMySQLBackup ## AutoMySQLBackup
apt_get_install_permanent mysql-client apt_install_permanent mysql-client
cd /opt cd /opt
wget "http://downloads.sourceforge.net/project/automysqlbackup/AutoMySQLBackup/AutoMySQLBackup VER $AUTOMYSQLBACKUP_VERSION_MAJOR/automysqlbackup-$AUTOMYSQLBACKUP_VERSION.tar.gz" wget "http://downloads.sourceforge.net/project/automysqlbackup/AutoMySQLBackup/AutoMySQLBackup VER $AUTOMYSQLBACKUP_VERSION_MAJOR/automysqlbackup-$AUTOMYSQLBACKUP_VERSION.tar.gz"
mkdir automysqlbackup mkdir automysqlbackup

View File

@@ -7,7 +7,7 @@ set -x
## BackInTime ## BackInTime
apt_get_install_permanent backintime-common python-dbus apt_install_permanent backintime-common python-dbus
## Configuration ## Configuration

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
## Chrome dependencies ## Chrome dependencies
apt_get_install_permanent gconf-service libasound2 libatk1.0-0 libcairo2 libcap2 libcups2 libcurl3 libfontconfig1 libgdk-pixbuf2.0-0 libgtk2.0-0 libnspr4 libnss3 libpango1.0-0 librtmp0 libxss1 libxtst6 xdg-utils apt_install_permanent gconf-service libasound2 libatk1.0-0 libcairo2 libcap2 libcups2 libcurl3 libfontconfig1 libgdk-pixbuf2.0-0 libgtk2.0-0 libnspr4 libnss3 libpango1.0-0 librtmp0 libxss1 libxtst6 xdg-utils
## Chrome ## Chrome
mkdir -p /usr/share/icons/hicolor mkdir -p /usr/share/icons/hicolor

View File

@@ -5,7 +5,7 @@ set -x
## Remove temporary packages for minimal builds ## Remove temporary packages for minimal builds
if [ $MODE == "minimal" ]; then if [ $MODE == "minimal" ]; then
cat /build/temporary | xargs apt_remove apt_remove "$(cat /build/temporary)"
fi fi
## Clean apt files ## Clean apt files

View File

@@ -4,4 +4,4 @@ source /build/config
set -x set -x
## collectd ## collectd
apt_get_install_permanent libsensors4 collectd apt_install_permanent libsensors4 collectd

View File

@@ -4,4 +4,4 @@ source /build/config
set -x set -x
## Often used tools ## Often used tools
apt_get_install_temporary gcc make automake libtool apt_install_temporary gcc make automake libtool

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
## Install cron daemon ## Install cron daemon
apt_get_install_permanent cron apt_install_permanent cron
## Remove useless cron entries ## Remove useless cron entries
# Checks for lost+found and scans for mtab # Checks for lost+found and scans for mtab

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
## Chrome dependencies ## Chrome dependencies
apt_get_install_permanent firefox apt_install_permanent firefox
## Pulseaudio script ## Pulseaudio script
echo "PULSE_SERVER=host firefox" > /opt/firefox echo "PULSE_SERVER=host firefox" > /opt/firefox

View File

@@ -7,5 +7,5 @@ set -x
export_env FTP_DATA /host/var/lib/ftp export_env FTP_DATA /host/var/lib/ftp
## Pure-FTPd ## Pure-FTPd
apt-get update apt update
apt_get_install_permanent pure-ftpd apt_install_permanent pure-ftpd

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
# GMediaRender dependencies # GMediaRender dependencies
apt_get_install_permanent libupnp-dev libgstreamer0.10-dev \ apt_install_permanent libupnp-dev libgstreamer0.10-dev \
gstreamer0.10-plugins-base gstreamer0.10-plugins-good \ gstreamer0.10-plugins-base gstreamer0.10-plugins-good \
gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly \ gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly \
gstreamer0.10-ffmpeg \ gstreamer0.10-ffmpeg \

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
## Hamachi dependency ## Hamachi dependency
apt_get_install_permanent lsb-core net-tools socat strace apt_install_permanent lsb-core net-tools socat strace
## Hamachi ## Hamachi
cd /opt cd /opt

View File

@@ -14,5 +14,5 @@ git clone https://github.com/rembo10/headphones.git
## Encoders ## Encoders
echo "deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu $(lsb_release -c -s) main" | sudo tee -a /etc/apt/sources.list echo "deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu $(lsb_release -c -s) main" | sudo tee -a /etc/apt/sources.list
apt-get update apt update
apt_get_install_permanent --force-yes ffmpeg libmp3lame0 libavcodec-extra-54 apt_install_permanent --force-yes ffmpeg libmp3lame0 libavcodec-extra-54

View File

@@ -11,9 +11,9 @@ export_env LIGHTTPD_CONFIG /etc/lighttpd/lighttpd.conf
export_env LIGHTTPD_LOG /host/var/log/lighttpd/error.log export_env LIGHTTPD_LOG /host/var/log/lighttpd/error.log
## Lighthttpd ## Lighthttpd
apt_get_install_permanent lighttpd apt_install_permanent lighttpd
apt-get build-dep -y lighttpd apt build-dep -y lighttpd
apt_get_install_temporary automake apt_install_temporary automake
cd /opt cd /opt
wget http://download.lighttpd.net/lighttpd/releases-$LIGHTTPD_VERSION_MAJOR.x/lighttpd-$LIGHTTPD_VERSION.tar.gz wget http://download.lighttpd.net/lighttpd/releases-$LIGHTTPD_VERSION_MAJOR.x/lighttpd-$LIGHTTPD_VERSION.tar.gz
tar xzf lighttpd-$LIGHTTPD_VERSION.tar.gz && \ tar xzf lighttpd-$LIGHTTPD_VERSION.tar.gz && \

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
# MiniDLNA dependencies # MiniDLNA dependencies
apt_get_install_permanent gettext libavutil-dev libavcodec-dev libavformat-dev libjpeg-dev libsqlite3-dev libexif-dev libid3tag0-dev libogg-dev libvorbis-dev libFLAC-dev apt_install_permanent gettext libavutil-dev libavcodec-dev libavformat-dev libjpeg-dev libsqlite3-dev libexif-dev libid3tag0-dev libogg-dev libvorbis-dev libFLAC-dev
export MINIDLNA_VERSION=1.1.1 export MINIDLNA_VERSION=1.1.1
export MINIDLNA_CONFIG=/host/etc/minidlna.conf export MINIDLNA_CONFIG=/host/etc/minidlna.conf

View File

@@ -6,7 +6,7 @@ set -x
## MySQL ## MySQL
debconf-set-selections <<< 'mariadb-server mariadb-server/root_password password dummy' debconf-set-selections <<< 'mariadb-server mariadb-server/root_password password dummy'
debconf-set-selections <<< 'mariadb-server mariadbql-server/root_password_again password dummy' debconf-set-selections <<< 'mariadb-server mariadbql-server/root_password_again password dummy'
apt_get_install_permanent mariadb-server apt_install_permanent mariadb-server
## Environment ## Environment
export_env MYSQL_CONFIG /etc/mysql/my.cnf export_env MYSQL_CONFIG /etc/mysql/my.cnf

View File

@@ -9,9 +9,9 @@ export_env PHP_CONFIG /usr/local/lib/php.ini
export_env PHP_TIMEZONE Europe/Amsterdam export_env PHP_TIMEZONE Europe/Amsterdam
## PHP ## PHP
apt_get_install_temporary gcc make apt_install_temporary gcc make
cd /opt cd /opt
apt_get_install_permanent libxml2-dev libcurl4-openssl-dev libbz2-dev libjpeg-dev libpng12-dev libmcrypt-dev apt_install_permanent libxml2-dev libcurl4-openssl-dev libbz2-dev libjpeg-dev libpng12-dev libmcrypt-dev
wget http://uk1.php.net/get/php-$PHP_VERSION.tar.gz/from/this/mirror -O php-$PHP_VERSION.tar.gz && \ wget http://uk1.php.net/get/php-$PHP_VERSION.tar.gz/from/this/mirror -O php-$PHP_VERSION.tar.gz && \
tar xzf php-$PHP_VERSION.tar.gz && \ tar xzf php-$PHP_VERSION.tar.gz && \
cd php-$PHP_VERSION cd php-$PHP_VERSION

View File

@@ -18,7 +18,7 @@ export_env INITRD no
## Enable Ubuntu Universe and Multiverse. ## Enable Ubuntu Universe and Multiverse.
sed -i 's/^#\s*\(deb.*universe\)$/\1/g' /etc/apt/sources.list sed -i 's/^#\s*\(deb.*universe\)$/\1/g' /etc/apt/sources.list
sed -i 's/^#\s*\(deb.*multiverse\)$/\1/g' /etc/apt/sources.list sed -i 's/^#\s*\(deb.*multiverse\)$/\1/g' /etc/apt/sources.list
apt-get update apt update
## Fix some issues with APT packages ## Fix some issues with APT packages
## See https://github.com/dotcloud/docker/issues/1024 ## See https://github.com/dotcloud/docker/issues/1024
@@ -37,11 +37,11 @@ ln -sf /bin/true /usr/bin/ischroot
ln -sf /bin/true /usr/bin/chfn ln -sf /bin/true /usr/bin/chfn
## Install HTTPS support for APT ## Install HTTPS support for APT
apt_get_install_permanent apt-transport-https apt_install_permanent apt-transport-https
## Upgrade all packages ## Upgrade all packages
apt-get dist-upgrade -y --no-install-recommends apt dist-upgrade -y --no-install-recommends
## Fix locale ## Fix locale
apt_get_install_permanent language-pack-en apt_install_permanent language-pack-en
locale-gen en_US locale-gen en_US

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
## Pulseaudio ## Pulseaudio
apt_get_install_permanent pulseaudio apt_install_permanent pulseaudio
## Setup environment ## Setup environment
sed -i "1iexport PULSE_SERVER=host" /root/.profile sed -i "1iexport PULSE_SERVER=host" /root/.profile

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
## Redis ## Redis
apt_get_install_permanent redis-server apt_install_permanent redis-server
export REDIS_CONFIG=/etc/redis/redis.conf export REDIS_CONFIG=/etc/redis/redis.conf
export REDIS_LOG=/host/var/log/redis/redis.log export REDIS_LOG=/host/var/log/redis/redis.log

View File

@@ -4,4 +4,4 @@ source /build/config
set -x set -x
## Install runit ## Install runit
apt_get_install_permanent runit apt_install_permanent runit

View File

@@ -11,11 +11,11 @@ export_env SABNZBD_DATA /host/var/lib/sabnzbd
## SABnzbd ## SABnzbd
echo "deb http://ppa.launchpad.net/jcfp/ppa/ubuntu $(lsb_release -c -s) main" | sudo tee -a /etc/apt/sources.list echo "deb http://ppa.launchpad.net/jcfp/ppa/ubuntu $(lsb_release -c -s) main" | sudo tee -a /etc/apt/sources.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:11371 --recv-keys 0x98703123E0F52B2BE16D586EF13930B14BB9F05F apt-key adv --keyserver hkp://keyserver.ubuntu.com:11371 --recv-keys 0x98703123E0F52B2BE16D586EF13930B14BB9F05F
apt-get update apt update
apt_get_install_permanent sabnzbdplus apt_install_permanent sabnzbdplus
## Utilities ## Utilities
apt_get_install_permanent unzip par2 python-openssl python-yenc apt_install_permanent unzip par2 python-openssl python-yenc
## Rar ## Rar
cd /opt cd /opt

View File

@@ -8,6 +8,6 @@ export_env SICKBEARD_CONFIG /host/etc/sickbeard/config.ini
export_env SICKBEARD_DATA /host/var/lib/sickbeard export_env SICKBEARD_DATA /host/var/lib/sickbeard
## SickBeard ## SickBeard
apt_get_install_permanent python-cheetah apt_install_permanent python-cheetah
cd /opt cd /opt
git clone https://github.com/midgetspy/Sick-Beard.git git clone https://github.com/midgetspy/Sick-Beard.git

View File

@@ -9,6 +9,6 @@ export_env SONARR_DATA /host/var/lib/sonarr
## Sonarr ## Sonarr
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC
echo "deb http://apt.sonarr.tv/ develop main" | tee -a /etc/apt/sources.list echo "deb http://apt.sonarr.tv/ develop main" | tee -a /etc/apt/sources.list
apt-get update apt update
apt_get_install_permanent nzbdrone mediainfo apt_install_permanent nzbdrone mediainfo
chmod +x /opt/NzbDrone/NzbDrone.exe chmod +x /opt/NzbDrone/NzbDrone.exe

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
## Install the SSH server ## Install the SSH server
apt_get_install_permanent openssh-server apt_install_permanent openssh-server
mkdir /var/run/sshd mkdir /var/run/sshd
## Install root key ## Install root key
@@ -19,7 +19,7 @@ ssh-keygen -t rsa -N "" -f id_rsa
cat /opt/id_rsa.pub >> "$AUTHORIZED_KEYS" cat /opt/id_rsa.pub >> "$AUTHORIZED_KEYS"
## X11 forwarding ## X11 forwarding
apt_get_install_permanent xauth apt_install_permanent xauth
## Setup environment ## Setup environment
sed -i "1iexport HOME=/root" /root/.profile sed -i "1iexport HOME=/root" /root/.profile

View File

@@ -4,6 +4,6 @@ source /build/config
set -x set -x
## Install a syslog daemon ## Install a syslog daemon
apt_get_install_permanent syslog-ng-core apt_install_permanent syslog-ng-core
mkdir -p /var/lib/syslog-ng mkdir -p /var/lib/syslog-ng
sed -i "s/^\(#SYSLOGNG_OPTS=\).*$/\1\"--no-caps --default-modules=affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat\"/" /etc/default/syslog-ng sed -i "s/^\(#SYSLOGNG_OPTS=\).*$/\1\"--no-caps --default-modules=affile,afprog,afsocket,afuser,basicfuncs,csvparser,dbparser,syslogformat\"/" /etc/default/syslog-ng

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
## Transmission ## Transmission
apt_get_install_permanent transmission-daemon jq apt_install_permanent transmission-daemon jq
## Environment ## Environment
export_env TRANSMISSION_CONFIG /host/etc/transmission export_env TRANSMISSION_CONFIG /host/etc/transmission

View File

@@ -4,7 +4,7 @@ source /build/config
set -x set -x
## UPnP Proxy dependency ## UPnP Proxy dependency
apt_get_install_permanent uuid-dev apt_install_permanent uuid-dev
## UPnP Proxy ## UPnP Proxy
cd opt cd opt

View File

@@ -4,8 +4,8 @@ source /build/config
set -x set -x
## Often used tools ## Often used tools
apt_get_install_permanent wget curl python-pip git apt_install_permanent wget curl python-pip git
apt_get_install_temporary inetutils-ping telnet apt_install_temporary inetutils-ping telnet
## Often used python modules ## Often used python modules
pip install argparse pip install argparse