Home > Software engineering >  Unable to install Redis extension in Docker php fpm-alpine image
Unable to install Redis extension in Docker php fpm-alpine image

Time:05-07

This is my Dockerfile

FROM php:8.1-fpm-alpine3.15
RUN apk update; \
    apk upgrade;

RUN apk add libzip-dev
RUN docker-php-ext-install zip

RUN apk add --no-cache libpng libpng-dev && docker-php-ext-install gd && apk del libpng-dev

RUN docker-php-ext-install mysqli pdo pdo_mysql

RUN apk add --no-cache pcre-dev $PHPIZE_DEPS && pecl install redis && docker-php-ext-enable redis.so

I receive back this error during building process

No releases available for package "pecl.php.net/redis"

CodePudding user response:

Check out this github issue: https://github.com/laradock/laradock/issues/1661 where someone had a similar issue in a different case. There are a couple of possible workarounds there.

Boils down to your connection possibly not being able to retrieve the package to you needing to do a couple of extra steps such as updating the channels before you can search for/install redis.

  • Related