Merge pull request #2952 from laradock/fix-2828

Fix Laravel-Horizon and PHP-Worker Build Issue
This commit is contained in:
Shao Yu-Lung (Allen) 2021-04-17 16:18:12 +08:00 committed by GitHub
commit b3cdfd5cd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 32 deletions

View File

@ -288,6 +288,7 @@ PHP_WORKER_INSTALL_GNUPG=false
PHP_WORKER_INSTALL_PGSQL=false PHP_WORKER_INSTALL_PGSQL=false
PHP_WORKER_INSTALL_MONGO=false PHP_WORKER_INSTALL_MONGO=false
PHP_WORKER_INSTALL_BCMATH=false PHP_WORKER_INSTALL_BCMATH=false
PHP_WORKER_INSTALL_MEMCACHED=false
# PHP_WORKER_INSTALL_OCI8 Does not work in php5.6 version # PHP_WORKER_INSTALL_OCI8 Does not work in php5.6 version
PHP_WORKER_INSTALL_OCI8=false PHP_WORKER_INSTALL_OCI8=false
PHP_WORKER_INSTALL_PHALCON=false PHP_WORKER_INSTALL_PHALCON=false

View File

@ -318,6 +318,7 @@ services:
- INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL} - INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL}
- INSTALL_MONGO=${PHP_WORKER_INSTALL_MONGO} - INSTALL_MONGO=${PHP_WORKER_INSTALL_MONGO}
- INSTALL_BCMATH=${PHP_WORKER_INSTALL_BCMATH} - INSTALL_BCMATH=${PHP_WORKER_INSTALL_BCMATH}
- INSTALL_MEMCACHED=${PHP_WORKER_INSTALL_MEMCACHED}
- INSTALL_OCI8=${PHP_WORKER_INSTALL_OCI8} - INSTALL_OCI8=${PHP_WORKER_INSTALL_OCI8}
- INSTALL_PHALCON=${PHP_WORKER_INSTALL_PHALCON} - INSTALL_PHALCON=${PHP_WORKER_INSTALL_PHALCON}
- INSTALL_SOAP=${PHP_WORKER_INSTALL_SOAP} - INSTALL_SOAP=${PHP_WORKER_INSTALL_SOAP}

View File

@ -23,7 +23,6 @@ RUN apk --update add wget \
curl \ curl \
git \ git \
build-base \ build-base \
libmemcached-dev \
libmcrypt-dev \ libmcrypt-dev \
libxml2-dev \ libxml2-dev \
pcre-dev \ pcre-dev \
@ -40,13 +39,6 @@ RUN apk --update add wget \
RUN pecl channel-update pecl.php.net; \ RUN pecl channel-update pecl.php.net; \
docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl 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; \
else \
pecl install memcached mcrypt-1.0.1; \
fi; \
docker-php-ext-enable memcached
# Add a non-root user to help install ffmpeg: # Add a non-root user to help install ffmpeg:
ARG PUID=1000 ARG PUID=1000
ENV PUID ${PUID} ENV PUID ${PUID}
@ -270,25 +262,20 @@ RUN if [ ${INSTALL_YAML} = true ]; then \
ARG INSTALL_MEMCACHED=false ARG INSTALL_MEMCACHED=false
RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
apk --update add libmemcached-dev; \
# Install the php memcached extension # Install the php memcached extension
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/2.2.0.tar.gz"; \ pecl install memcached-2.2.0; \
else \ else \
curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/v3.1.4.tar.gz"; \ pecl install memcached; \
fi \ fi; \
&& mkdir -p memcached \ docker-php-ext-enable memcached; \
&& tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \ php -m | grep -r 'memcached'; \
&& ( \ fi
cd memcached \
&& phpize \ #--------------------------------------------------------------------------
&& ./configure \ # Clean up
&& make -j$(nproc) \ #--------------------------------------------------------------------------
&& make install \
) \
&& rm -r memcached \
&& rm /tmp/memcached.tar.gz \
&& docker-php-ext-enable memcached \
;fi
RUN rm /var/cache/apk/* \ RUN rm /var/cache/apk/* \
&& mkdir -p /var/www && mkdir -p /var/www

View File

@ -23,7 +23,6 @@ RUN apk --update add wget \
curl \ curl \
git \ git \
build-base \ build-base \
libmemcached-dev \
libmcrypt-dev \ libmcrypt-dev \
libxml2-dev \ libxml2-dev \
pcre-dev \ pcre-dev \
@ -40,13 +39,6 @@ RUN apk --update add wget \
RUN pecl channel-update pecl.php.net; \ RUN pecl channel-update pecl.php.net; \
docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl 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; \
else \
pecl install memcached mcrypt-1.0.1; \
fi; \
docker-php-ext-enable memcached
# Add a non-root user: # Add a non-root user:
ARG PUID=1000 ARG PUID=1000
ENV PUID ${PUID} ENV PUID ${PUID}
@ -404,6 +396,24 @@ RUN if [ ${INSTALL_XMLRPC} = true ]; then \
php -m | grep -r 'xmlrpc'; \ php -m | grep -r 'xmlrpc'; \
fi fi
###########################################################################
# PHP Memcached:
###########################################################################
ARG INSTALL_MEMCACHED=false
RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
apk --update add libmemcached-dev; \
# Install the php memcached extension
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install memcached-2.2.0; \
else \
pecl install memcached; \
fi; \
docker-php-ext-enable memcached; \
php -m | grep -r 'memcached'; \
fi
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Optional Supervisord Configuration # Optional Supervisord Configuration