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
user7593291
source
share