FROM hub.hexin.cn:9082/library/centos:6.6 COPY ./script /usr/local/src/script RUN sh /usr/local/src/script/install.sh && sh /usr/local/src/script/installphp.sh && sh /usr/local/src/script/installpython.sh
wget 'http://jp2.php.net/distributions/php-5.6.39.tar.gz' tar -xvzf php-5.6.39.tar.gz cd php-5.6.39 ./configure --prefix=/usr/local/php5.6 --with-config-file-path=/usr/local/php5.6/etc --with-curl --enable-fpm --with-freetype-dir --with-pdo-mysql --with-iconv --enable-mbstring --enable-pcntl --enable-zip --with-apxs2=/usr/sbin/apxs --with-imap-ssl cd ./ext/imap /usr/local/php5.6/bin/phpize yum -y install krb5* ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so mkdir -p /usr/kerberos ln -s /usr/lib64 /usr/kerberos/lib ./configure --with-php-config=/usr/local/php5.6/bin/php-config --with-kerberos=/usr/kerberos --with-imap-ssl make make install
这里安装php的imap扩展会稍微麻烦一些,折腾了一会。
installpython.sh
1 2 3 4 5 6
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz tar xzf Python-3.5.1.tgz cd Python-3.5.1 ./configure --prefix=/usr/local/python3/ make altinstall ln -s /usr/local/python3/bin/python3.5 /usr/bin/python3