diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 0d48203..487366a 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -26,20 +26,26 @@ RUN apk --update add wget \ libmemcached-dev \ libmcrypt-dev \ libxml2-dev \ + pcre-dev \ zlib-dev \ autoconf \ cyrus-sasl-dev \ libgsasl-dev \ - supervisor \ oniguruma-dev \ + libressl \ + libressl-dev \ + supervisor \ procps -RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl +RUN pecl channel-update pecl.php.net; \ + docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl + RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ - pecl channel-update pecl.php.net && pecl install memcached-2.2.0 mcrypt-1.0.1 && docker-php-ext-enable memcached \ -;else \ - pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached \ -;fi + pecl install memcached-2.2.0 mcrypt-1.0.1; \ + else \ + pecl install memcached mcrypt-1.0.1; \ + fi; \ + docker-php-ext-enable memcached # Add a non-root user to help install ffmpeg: ARG PUID=1000 @@ -158,10 +164,14 @@ RUN set -eux; \ ARG INSTALL_PHPREDIS=false RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ # Install Php Redis Extension - printf "\n" | pecl install -o -f redis \ - && rm -rf /tmp/pear \ - && docker-php-ext-enable redis \ -;fi + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + printf "\n" | pecl install -o -f redis-4.3.0; \ + else \ + printf "\n" | pecl install -o -f redis; \ + fi; \ + rm -rf /tmp/pear; \ + docker-php-ext-enable redis; \ +fi ARG INSTALL_FFMPEG=false RUN if [ ${INSTALL_FFMPEG} = true ]; then \ @@ -222,9 +232,14 @@ RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ # Install MongoDB drivers: ARG INSTALL_MONGO=false RUN if [ ${INSTALL_MONGO} = true ]; then \ - pecl install mongodb \ - && docker-php-ext-enable mongodb \ - ;fi + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install mongo; \ + docker-php-ext-enable mongo; \ + else \ + pecl install mongodb; \ + docker-php-ext-enable mongodb; \ + fi; \ + fi ########################################################################### # YAML: extension @@ -235,16 +250,20 @@ ARG INSTALL_YAML=false RUN if [ ${INSTALL_YAML} = true ]; then \ apk --update add -U --no-cache --virtual temp yaml-dev \ && apk add --no-cache yaml \ - && docker-php-source extract \ - && pecl channel-update pecl.php.net \ - && pecl install yaml \ + && docker-php-source extract; \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install yaml-1.3.2; \ + elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ + pecl install yaml-2.0.4; \ + else \ + pecl install yaml; \ + fi \ && docker-php-ext-enable yaml \ && pecl clear-cache \ && docker-php-source delete \ && apk del temp \ ;fi - ########################################################################### # PHP Memcached: ########################################################################### diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 3a02f9e..1514c37 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -40,10 +40,11 @@ RUN pecl channel-update pecl.php.net; \ docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ - pecl install memcached-2.2.0 mcrypt-1.0.1 && docker-php-ext-enable memcached \ -;else \ - pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached \ -;fi + pecl install memcached-2.2.0 mcrypt-1.0.1; \ + else \ + pecl install memcached mcrypt-1.0.1; \ + fi; \ + docker-php-ext-enable memcached # Add a non-root user: ARG PUID=1000