|
| 1 | +ARG PHP_VERSION |
| 2 | +FROM php:${PHP_VERSION}-cli |
| 3 | + |
| 4 | +RUN docker-php-ext-install pdo |
| 5 | +RUN docker-php-ext-install pdo_mysql |
| 6 | + |
| 7 | +# Install mbstring PHP extension |
| 8 | +# |
| 9 | +RUN set -eux; \ |
| 10 | + apt-get update; \ |
| 11 | + apt-get install -y --no-upgrade --no-install-recommends \ |
| 12 | + libonig-dev \ |
| 13 | + ; \ |
| 14 | + \ |
| 15 | + apt-get clean; \ |
| 16 | + rm -rf /var/lib/apt/lists/*; \ |
| 17 | + \ |
| 18 | + docker-php-ext-install mbstring |
| 19 | + |
| 20 | +# Install APCu PHP extension |
| 21 | +# |
| 22 | +ARG APCU_VERSION |
| 23 | +RUN set -eux; \ |
| 24 | + \ |
| 25 | + test x"" = x"${APCU_VERSION}" || { \ |
| 26 | + pecl install apcu-${APCU_VERSION}; \ |
| 27 | + docker-php-ext-enable apcu; \ |
| 28 | + \ |
| 29 | + rm -r /tmp/pear; \ |
| 30 | + } |
| 31 | + |
| 32 | +# Install memcache PHP extension |
| 33 | +# |
| 34 | +ARG MEMCACHE_VERSION |
| 35 | +RUN set -eux; \ |
| 36 | + buildDeps=' \ |
| 37 | + libzip-dev \ |
| 38 | + '; \ |
| 39 | + apt-get update; \ |
| 40 | + apt-get install -y --no-upgrade --no-install-recommends \ |
| 41 | + $buildDeps \ |
| 42 | + ; \ |
| 43 | + \ |
| 44 | + pecl install memcache-${MEMCACHE_VERSION}; \ |
| 45 | + docker-php-ext-enable memcache; \ |
| 46 | + \ |
| 47 | + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=true \ |
| 48 | + $buildDeps \ |
| 49 | + ; \ |
| 50 | + apt-get clean; \ |
| 51 | + rm -rf /var/lib/apt/lists/*; \ |
| 52 | + rm -r /tmp/pear |
| 53 | + |
| 54 | +# For consistent mime type file guesser |
| 55 | +RUN set -eux; \ |
| 56 | + distFilePath=`which file`; \ |
| 57 | + \ |
| 58 | + mv ${distFilePath} ${distFilePath}.dist; \ |
| 59 | + { \ |
| 60 | + echo '#! /bin/sh -eu'; \ |
| 61 | + echo ''; \ |
| 62 | + echo "${distFilePath}"'.dist "$@" | sed -e s,application/x-pie-executable,application/x-executable,g'; \ |
| 63 | + } | tee ${distFilePath}; \ |
| 64 | + \ |
| 65 | + chmod +x ${distFilePath}; \ |
| 66 | + \ |
| 67 | + file /bin/ls --mime | grep application/x-executable; \ |
| 68 | + :; |
0 commit comments