Public Repository

Last pushed: 2 years ago
Short Description
Slackware64 14.1 + Apache 2.4.10 + PHP 5.5.17 (mod_php) (Imagick, GeoIP, Imap)
Full Description

Dockerfile:

# Apache 2.4.10 + PHP 5.5.17 (mod_php)
#
# VERSION                             0.0.1

FROM            zakame/slackware

#ENV CFLAGS "-march=native -O3 -pipe -fomit-frame-pointer" 
#ENV CXXFLAGS "-march=native -O3 -pipe -fomit-frame-pointer" 

#System update
RUN echo "http://slackware.mirrors.ovh.net/ftp.slackware.com/slackware64-14.1/" > /etc/slackpkg/mirrors && slackpkg update && slackpkg -batch=on -default_answer=y upgrade-all

#Apache / PHP dependencies
RUN slackpkg -batch=on -default_answer=y install make zlib glibc glib glib2 binutils kernel-headers libtool gmp libmpc libelf libxml2 openssl openldap-client sqlite expat pcre apr-util sasl db44 m4 libpng libjpeg freetype curl libidn libmcrypt mpfr automake autoconf pkg-config perl && slackpkg -batch=on -default_answer=y install "apr-[0-9]" && slackpkg -batch=on -default_answer=y install "gcc-[0-9]" && slackpkg -batch=on -default_answer=y install "gcc-g[+]" 

#Get apache
RUN mkdir /home/compilation ; cd /home/compilation ; (wget http://apache.crihan.fr/dist/httpd/httpd-2.4.10.tar.gz && tar xf httpd-2.4.10.tar.gz)

#Configure apache
RUN /home/compilation/httpd-2.4.10/configure --prefix=/usr/local/apache2 --enable-so --enable-http --enable-ssl --enable-deflate --enable-rewrite --disable-authz-groupfile --disable-autoindex --disable-cgid --disable-cgid CFLAGS="-march=native -O3 -pipe -fomit-frame-pointer" CXXFLAGS="-march=native -O3 -pipe -fomit-frame-pointer" && make -j `grep -c ^processor /proc/cpuinfo` && make install

#Imap extension
RUN cd /home/compilation && wget ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz && tar xf imap-2007f.tar.gz && (mkdir /usr/local/ssl ; ln -s /usr/include/openssl/ /usr/local/ssl/include ; cd /home/compilation/imap-2007f ; sed -i "s/EXTRACFLAGS=$/EXTRACFLAGS=-fPIC/" Makefile && make slx && (mkdir lib ; mkdir include ; cp c-client/*.c lib/ && cp c-client/*.h include/ && cp c-client/c-client.a lib/libc-client.a))

#Get php
RUN cd /home/compilation && wget -O php-5.5.17.tar.gz http://fr2.php.net/get/php-5.5.17.tar.gz/from/this/mirror && tar xf php-5.5.17.tar.gz

#Configure PHP
RUN CFLAGS="-march=native -O3 -pipe -fomit-frame-pointer" CXXFLAGS="-march=native -O3 -pipe -fomit-frame-pointer" /home/compilation/php-5.5.17/configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs -with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --without-sqlite3 --without-pdo-sqlite --with-mcrypt --with-gd --with-libdir=lib64 --with-jpeg-dir --with-png-dir --with-freetype-dir --with-curl --with-zlib --with-openssl --with-gettext --enable-mbstring --enable-soap --enable-zip --enable-ftp --enable-pcntl --disable-ipv6 --disable-cgi --disable-short-tags --with-imap=/home/compilation/imap-2007f --with-imap-ssl && make -j `grep -c ^processor /proc/cpuinfo` && make install

#User and groups
RUN (mkdir /home/users/ ; mkdir /home/users/webserver) && groupadd www && useradd -d /home/users/webserver -s /bin/bash -g www webserver 


#Geoip
RUN cd /home/compilation/ ; wget "http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz" && tar xf GeoIP.tar.gz && cd GeoIP* && aclocal && autoconf && libtoolize -f && CFLAGS="-march=native -O3 -pipe -fomit-frame-pointer" CXXFLAGS="-march=native -O3 -pipe -fomit-frame-pointer" ./configure && make && make install && cd /usr/local/php5/bin/ && ./pecl install geoip

#Geoip DB
RUN mkdir /usr/share/GeoIP; chown webserver:www /usr/share/GeoIP/; cd /usr/share/GeoIP/ ; wget "http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz" && gunzip GeoLiteCity.dat.gz && mv GeoLiteCity.dat GeoIPCity.dat && wget "http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" && gunzip GeoIP.dat.gz && chown webserver:www GeoIP.dat && chown webserver:www GeoIPCity.dat

#Imagick
RUN cd /home/compilation && wget "http://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/ImageMagick-6.8.9-7.tar.xz" && tar xf ImageMagick-6.8.9-7.tar.xz && cd ImageMagick-6.8.9-7 && CFLAGS="-march=native -O3 -pipe -fomit-frame-pointer" CXXFLAGS="-march=native -O3 -pipe -fomit-frame-pointer" ./configure && make -j `grep -c ^processor /proc/cpuinfo` && make install && cd /usr/local/php5/bin/ && ./pecl install imagick-3.2.0RC1

#Copy extensions
RUN find /usr/local/php5/lib/php/extensions/ -type f -name '*.so' -exec mv {} /usr/local/php5/lib/php/extensions/ \;

#PHP Conf
COPY conf/php/php.ini /home/server/conf/php/php.ini
RUN mkdir /home/server ; mkdir /home/server/logs; mkdir /home/server/conf; mkdir /home/server/conf/php/ ; rm /usr/local/php5/lib/php/php.ini ; ln -s /home/server/conf/php/php.ini /usr/local/php5/lib/php/php.ini 

#Apache conf
RUN mkdir /home/server/htdocs/; mkdir /home/server/htdocs/project/; mkdir /home/server/htdocs/frameworks; mkdir /home/server/htdocs/frameworks/kite ; mkdir /home/server/conf/apache/

COPY htdocs/kite/ /home/server/htdocs/frameworks/kite/
COPY conf/apache/ /home/server/conf/apache/

RUN chown -R webserver:www /home/server/htdocs/ && rm -rf /usr/local/apache2/conf && ln -s /home/server/conf/apache/ /usr/local/apache2/conf && rm -rf /usr/local/apache2/logs && ln -s /home/server/logs /usr/local/apache2/logs

COPY conf/apache/ /home/server/conf/apache/

#cleaning
RUN rm -rf /home/compilation/ && slackpkg -batch=on -default_answer=y remove "gcc-[0-9]" && slackpkg -batch=on -default_answer=y remove gcc

EXPOSE 80
Docker Pull Command
Owner
ipernet

Comments (0)