Merge pull request #2960 from laradock/fix-ci

feat(CI build failed):  php-fpm AMQP
This commit is contained in:
Shao Yu-Lung (Allen) 2021-04-26 10:38:14 +08:00 committed by GitHub
commit 618a9d180c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 26 deletions

View File

@ -410,32 +410,18 @@ RUN set -eux; \
ARG INSTALL_AMQP=false ARG INSTALL_AMQP=false
RUN if [ ${INSTALL_AMQP} = true ]; then \ RUN set -eux; \
# download and install manually, to make sure it's compatible with ampq installed by pecl later if [ ${INSTALL_AMQP} = true ]; then \
# install cmake first # # Install the amqp extension
apt-get -yqq install cmake && \ apt-get -yqq install librabbitmq-dev; \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ] || [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \
curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/v0.11.0.tar.gz; \
else \
curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/master.tar.gz; \
fi && \
mkdir -p rabbitmq-c && \
tar -C rabbitmq-c -zxvf /tmp/rabbitmq-c.tar.gz --strip 1 && \
cd rabbitmq-c/ && \
mkdir _build && cd _build/ && \
cmake .. && \
cmake --build . --target install && \
# Install the amqp extension
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
printf "\n" | pecl install amqp-1.11.0beta; \ pecl install amqp-1.11.0beta; \
else \ else \
printf "\n" | pecl install amqp; \ pecl install amqp; \
fi && \ fi; \
docker-php-ext-enable amqp && \ docker-php-ext-enable amqp; \
# Install the sockets extension php -m | grep -oiE '^amqp$'; \
docker-php-ext-install sockets && \ fi
php -m | grep -q 'sockets' \
;fi
########################################################################### ###########################################################################
# CASSANDRA: # CASSANDRA: