I am trying to install sqlsrv drivers for php with Dockerfile, but it is not working, I am getting error that pecl sqlsrv requires php 8.1, current version 7.4. I cannot update php to 8.1 because there are other dependencies, is there any other way I can install sqlsrv for php 7.4. Here is the dockerfile
FROM php:7.4-cli as php
RUN apt-get update -y
RUN apt-get install -y unzip libpq-dev libcurl4-gnutls-dev gnupg2 zlib1g-dev libpng-dev libnss3-dev libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon-x11-0 libxcomposite-dev libxdamage1 libxfixes-dev libxrandr2 libgbm-dev libpangocairo-1.0-0 libcairo2 libasound2
RUN docker-php-ext-install pdo pdo_mysql bcmath gd exif
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get -y --no-install-recommends install msodbcsql17 unixodbc-dev
# RUN ACCEPT_EULA=Y apt-get install -y mssql-tools
RUN pecl install sqlsrv
RUN pecl install pdo_sqlsrv
# RUN docker-php-ext-enable sqlsrv pdo_sqlsrv
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
RUN npm install
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www
COPY . .
ENV PORT=9000
ENTRYPOINT [ "Docker/entrypoint.sh" ]