fix amqp build faild

#2959
This commit is contained in:
Shao Yu-Lung (Allen) 2021-04-25 23:48:10 +08:00
parent 91575b115c
commit 78e0d4d54c

View File

@ -410,32 +410,19 @@ 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 update; \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ] || [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \ apt-get -yqq install librabbitmq-dev; \
curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/v0.11.0.tar.gz; \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
else \ pecl install amqp-1.11.0beta; \
curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/master.tar.gz; \ else \
fi && \ pecl install amqp; \
mkdir -p rabbitmq-c && \ fi; \
tar -C rabbitmq-c -zxvf /tmp/rabbitmq-c.tar.gz --strip 1 && \ docker-php-ext-enable amqp; \
cd rabbitmq-c/ && \ php -m | grep -oiE '^amqp$'; \
mkdir _build && cd _build/ && \ fi
cmake .. && \
cmake --build . --target install && \
# Install the amqp extension
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
printf "\n" | pecl install amqp-1.11.0beta; \
else \
printf "\n" | pecl install amqp; \
fi && \
docker-php-ext-enable amqp && \
# Install the sockets extension
docker-php-ext-install sockets && \
php -m | grep -q 'sockets' \
;fi
########################################################################### ###########################################################################
# CASSANDRA: # CASSANDRA: