Docker installs memcached

I am trying to install memcached in a Dockerfile, but I keep getting the same error. Everything worked fine, but it looks like some layers were cached by I, and the images were built without any problems. But since I cleared the cache, I cannot create an image. Here are some of them:

FROM php:5-apache

RUN apt-get install -y libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev
RUN pecl install memcached
RUN echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini

There are many other things that are installed, but as I said, everything works before. The error is that memcached requires php7 to start. I don't know if something has changed in recent builds of the library, but it looks like it refuses to work with php5. Here is the error:

pecl/memcached requires PHP (version >= 7.0.0), installed version is 5.6.30
pecl/memcached can optionally use PHP extension "igbinary" (version >= 2.0)
pecl/memcached can optionally use PHP extension "msgpack" (version >= 2.0)
No valid packages found
install failed
The command '/bin/sh -c pecl install memcached' returned a non-zero code: 1
+4
source share
1 answer

memcached PECL PHP 7 3.0.0. 2.x :

FROM php:5-apache

RUN apt-get update && apt-get install -y libmemcached11 libmemcachedutil2 build-essential libmemcached-dev libz-dev
RUN pecl install memcached-2.2.0
RUN echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini
+5

Source: https://habr.com/ru/post/1670298/


All Articles