feat(cassandra extension): upgrade version of cassandra and avoid installation for PHP 8.0

Cassandra should not be installed for PHP 8.0 due to unsupported PHP driver. See the issue's references.

Closes #2876
This commit is contained in:
Pavel Savushkin 2021-03-14 15:17:38 +02:00
parent ac52c18728
commit 0c085f4984
No known key found for this signature in database
GPG Key ID: BD2EDA3E125300DD
1 changed files with 26 additions and 22 deletions

View File

@ -516,28 +516,32 @@ RUN if [ ${INSTALL_AMQP} = true ]; then \
ARG INSTALL_CASSANDRA=false
RUN if [ ${INSTALL_CASSANDRA} = true ]; then \
apt-get install libgmp-dev -y && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.28.0/libuv1-dev_1.28.0-1_amd64.deb -o libuv1-dev.deb && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.28.0/libuv1_1.28.0-1_amd64.deb -o libuv1.deb && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.12.0/cassandra-cpp-driver-dev_2.12.0-1_amd64.deb -o cassandra-cpp-driver-dev.deb && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.12.0/cassandra-cpp-driver_2.12.0-1_amd64.deb -o cassandra-cpp-driver.deb && \
dpkg -i libuv1.deb && \
dpkg -i libuv1-dev.deb && \
dpkg -i cassandra-cpp-driver.deb && \
dpkg -i cassandra-cpp-driver-dev.deb && \
rm libuv1.deb libuv1-dev.deb cassandra-cpp-driver-dev.deb cassandra-cpp-driver.deb && \
cd /usr/src && \
git clone https://github.com/datastax/php-driver.git && \
cd /usr/src/php-driver/ext && \
phpize && \
mkdir /usr/src/php-driver/build && \
cd /usr/src/php-driver/build && \
../ext/configure > /dev/null && \
make clean >/dev/null && \
make >/dev/null 2>&1 && \
make install && \
echo "extension=cassandra.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini && \
ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-cassandra.ini \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
echo "PHP Driver for Cassandra is not supported for PHP 8.0."; \
else \
apt-get install libgmp-dev -yqq && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1-dev_1.35.0-1_amd64.deb -o libuv1-dev.deb && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1_1.35.0-1_amd64.deb -o libuv1.deb && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver-dev_2.16.0-1_amd64.deb -o cassandra-cpp-driver-dev.deb && \
curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver_2.16.0-1_amd64.deb -o cassandra-cpp-driver.deb && \
dpkg -i libuv1.deb && \
dpkg -i libuv1-dev.deb && \
dpkg -i cassandra-cpp-driver.deb && \
dpkg -i cassandra-cpp-driver-dev.deb && \
rm libuv1.deb libuv1-dev.deb cassandra-cpp-driver-dev.deb cassandra-cpp-driver.deb && \
cd /usr/src && \
git clone https://github.com/datastax/php-driver.git && \
cd /usr/src/php-driver/ext && \
phpize && \
mkdir /usr/src/php-driver/build && \
cd /usr/src/php-driver/build && \
../ext/configure > /dev/null && \
make clean >/dev/null && \
make >/dev/null 2>&1 && \
make install && \
echo "extension=cassandra.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini && \
ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-cassandra.ini; \
fi \
;fi
###########################################################################