|
| 1 | +# This image is for googleapis/google-cloud-php repo. |
| 2 | +FROM gcr.io/gcp-runtimes/ubuntu_16_0_4 |
| 3 | +ENV PHP_DIR=/opt/php55 |
| 4 | +ENV PHP_SRC_DIR=/usr/local/src/php55-build |
| 5 | +ENV PATH=${PATH}:/usr/local/bin:${PHP_DIR}/bin |
| 6 | + |
| 7 | +RUN apt-get update && \ |
| 8 | + apt-get -y install \ |
| 9 | + autoconf \ |
| 10 | + build-essential \ |
| 11 | + git-core \ |
| 12 | + libbz2-dev \ |
| 13 | + libcurl4-openssl-dev \ |
| 14 | + libc-client2007e \ |
| 15 | + libc-client2007e-dev \ |
| 16 | + libfcgi-dev \ |
| 17 | + libfcgi0ldbl \ |
| 18 | + libfreetype6-dev \ |
| 19 | + libicu-dev \ |
| 20 | + libjpeg62-dbg \ |
| 21 | + libjpeg-dev \ |
| 22 | + libkrb5-dev \ |
| 23 | + libmcrypt-dev \ |
| 24 | + libpng12-dev \ |
| 25 | + libpq-dev \ |
| 26 | + libssl-dev \ |
| 27 | + libxml2-dev \ |
| 28 | + libxslt1-dev \ |
| 29 | + libzip-dev \ |
| 30 | + wget \ |
| 31 | + zip |
| 32 | + |
| 33 | +RUN wget -nv -O phpunit.phar https://phar.phpunit.de/phpunit-4.phar && \ |
| 34 | + chmod +x phpunit.phar && \ |
| 35 | + mv phpunit.phar /usr/local/bin/phpunit && \ |
| 36 | + ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a && \ |
| 37 | + mkdir ${PHP_DIR} ${PHP_SRC_DIR} && \ |
| 38 | + cd ${PHP_SRC_DIR} && \ |
| 39 | + wget http://us1.php.net/get/php-5.5.38.tar.bz2/from/this/mirror \ |
| 40 | + -O php-5.5.38.tar.bz2 && \ |
| 41 | + tar jxf php-5.5.38.tar.bz2 && \ |
| 42 | + cd php-5.5.38 && \ |
| 43 | + ./configure \ |
| 44 | + --prefix=${PHP_DIR} \ |
| 45 | + --with-pdo-pgsql \ |
| 46 | + --with-zlib-dir \ |
| 47 | + --with-freetype-dir \ |
| 48 | + --enable-mbstring \ |
| 49 | + --with-libxml-dir=/usr \ |
| 50 | + --enable-soap \ |
| 51 | + --enable-intl \ |
| 52 | + --enable-calendar \ |
| 53 | + --with-curl \ |
| 54 | + --with-mcrypt \ |
| 55 | + --with-zlib \ |
| 56 | + --with-gd \ |
| 57 | + --with-pgsql \ |
| 58 | + --disable-rpath \ |
| 59 | + --enable-inline-optimization \ |
| 60 | + --with-bz2 \ |
| 61 | + --with-zlib \ |
| 62 | + --enable-sockets \ |
| 63 | + --enable-sysvsem \ |
| 64 | + --enable-sysvshm \ |
| 65 | + --enable-sysvmsg \ |
| 66 | + --enable-pcntl \ |
| 67 | + --enable-mbregex \ |
| 68 | + --enable-exif \ |
| 69 | + --enable-bcmath \ |
| 70 | + --with-mhash \ |
| 71 | + --enable-zip \ |
| 72 | + --with-pcre-regex \ |
| 73 | + --with-mysql \ |
| 74 | + --with-pdo-mysql \ |
| 75 | + --with-mysqli \ |
| 76 | + --with-jpeg-dir=/usr \ |
| 77 | + --with-png-dir=/usr \ |
| 78 | + --enable-gd-native-ttf \ |
| 79 | + --with-openssl \ |
| 80 | + --with-fpm-user=www-data \ |
| 81 | + --with-fpm-group=www-data \ |
| 82 | + --with-libdir=/lib/x86_64-linux-gnu \ |
| 83 | + --enable-ftp \ |
| 84 | + --with-imap \ |
| 85 | + --with-imap-ssl \ |
| 86 | + --with-gettext \ |
| 87 | + --with-xmlrpc \ |
| 88 | + --with-xsl \ |
| 89 | + --with-kerberos \ |
| 90 | + --enable-fpm && \ |
| 91 | + make && \ |
| 92 | + make install && \ |
| 93 | + pecl install grpc && \ |
| 94 | + cp php.ini-production ${PHP_DIR}/lib/php.ini && \ |
| 95 | + echo 'zend_extension=opcache.so' >> ${PHP_DIR}/lib/php.ini && \ |
| 96 | + echo 'extension=grpc.so' >> ${PHP_DIR}/lib/php.ini && \ |
| 97 | + php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ |
| 98 | + php -r "if (hash_file('SHA384', 'composer-setup.php') === rtrim(file_get_contents('https://composer.github.io/installer.sig'))) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ |
| 99 | + php composer-setup.php --filename=composer --install-dir=/usr/local/bin |
0 commit comments