Reorganize some files and import some others

This commit is contained in:
2015-01-14 15:14:22 +00:00
parent c03924f6a6
commit ecb0bb0815
29 changed files with 151 additions and 158 deletions

View File

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

View File

@@ -9,5 +9,11 @@ mkdir -p $LD_LIBRARY_PATH
cp /lib/x86_64-linux-gnu/libnss_files.so.2 $LD_LIBRARY_PATH
sed -i 's,/etc/hosts,/tmp/hosts,' $LD_LIBRARY_PATH/libnss_files.so.2
## Other commands
# ENV LD_LIBRARY_PATH /root/lib
# RUN mkdir $LD_LIBRARY_PATH
# RUN cp /lib/x86_64-linux-gnu/libnss_files.so.2 $LD_LIBRARY_PATH
# RUN perl -pi -e 's:/etc/hosts:/tmp/hosts:g' $LD_LIBRARY_PATH/libnss_files.so.2
## Environment variable
echo -n $LD_LIBRARY_PATH > /etc/container_environment/LD_LIBRARY_PATH

View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -e
source /build/config
set -x
## Enable configuration PHP in Lighttpd
ln -s /etc/lighttpd/conf-available/10-fastcgi.conf /etc/lighttpd/conf-enabled/10-fastcgi.conf
ln -s /etc/lighttpd/conf-available/15-fastcgi-php.conf /etc/lighttpd/conf-enabled/15-fastcgi-php.conf

18
build/scripts/lighttpd.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
set -e
source /build/config
set -x
## Lighthttpd
apt_get_install_permanent lighttpd
## Environment
export_env LIGHTTPD_CONFIG /etc/lighttpd/lighttpd.conf
export_env LIGHTTPD_DOMAINS /host/etc/lighttpd
export_env LIGHTTPD_LOG /host/var/log/lighttpd/error.log
export_env LIGHTTPD_DATA /host/var/www/global
## Configuration
sed -i "s,^\(server.errorlog\s*=\s*\).*$,\1\"$LIGHTTPD_LOG\"," $LIGHTTPD_CONFIG
sed -i "s,^\(server.document-root\s*=\s*\).*$,\1\"$LIGHTTPD_DATA\"," $LIGHTTPD_CONFIG
echo "include_shell \"cat $LIGHTTPD_DOMAINS/*.conf\"" >> $LIGHTTPD_CONFIG

19
build/scripts/mysql.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -e
source /build/config
set -x
## MySQL
debconf-set-selections <<< 'mysql-server mysql-server/root_password password dummy'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password dummy'
apt_get_install_permanent mysql-server
## Environment
export_env MYSQL_CONFIG /etc/mysql/my.cnf
export_env MYSQL_LOG /host/var/log/mysql/error.log
export_env MYSQL_DATA /host/var/lib/mysql
## Configuration
sed -i "s,^\(log_error\s*=\s*\).*$,\1$MYSQL_LOG," $MYSQL_CONFIG
sed -i "s,^\(datadir\s*=\s*\).*$,\1$MYSQL_DATA," $MYSQL_CONFIG
sed -i "s,^\(bind-address\s*=\s*\).*$,\10.0.0.0," $MYSQL_CONFIG

27
build/scripts/php.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -e
source /build/config
set -x
## Environment
export_env PHP_VERSION 5.6.4
export_env PHP_CONFIG /usr/local/lib/php.ini
export_env PHP_TIMEZONE Europe/Amsterdam
## PHP
apt_get_install_temporary gcc make
cd /opt
#wget http://ftp.us.debian.org/debian/pool/main/l/linux/linux-libc-dev_3.2.54-2_amd64.deb
#dpkg -i linux-libc-dev_3.2.54-2_amd64.deb
apt_get_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 && \
tar xzf php-$PHP_VERSION.tar.gz && \
cd php-$PHP_VERSION
./configure --enable-calendar --enable-bcmath --with-bz2 --enable-ctype --without-gdbm --with-iconv --enable-exif --enable-ftp --with-gettext --enable-mbstring --enable-sockets --with-zlib --enable-soap --enable-zip --with-mhash --with-curl --with-gd --with-mysql --with-jpeg-dir --with-openssl --with-mysqli --with-mcrypt
make
make install
## Configuration
cp /opt/php-$PHP_VERSION/php.ini-production $PHP_CONFIG
sed -i "s,^;\(date\.timezone\s*=\s*\)$,\1 $PHP_TIMEZONE," $PHP_CONFIG
ln -s /usr/local/bin/php-cgi /usr/bin/php-cgi

View File

@@ -30,11 +30,15 @@ ln -sf /bin/true /sbin/initctl
dpkg-divert --local --rename --add /usr/bin/ischroot
ln -sf /bin/true /usr/bin/ischroot
## Fix known issue with user accounts
## https://github.com/docker/docker/issues/6345#issuecomment-49245365
ln -sf /bin/true /usr/bin/chfn
## Install HTTPS support for APT
apt_get_install_permanent apt-transport-https
## Upgrade all packages
#apt-get dist-upgrade -y --no-install-recommends
apt-get dist-upgrade -y --no-install-recommends
## Fix locale
apt_get_install_permanent language-pack-en

View File

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