简体   繁体   English

Docker安装memcached

[英]Docker install memcached

I am trying to install memcached in Dockerfile but I keep getting th same error. 我试图在Dockerfile中安装memcached但我一直遇到同样的错误。 Everything was working fine but looks like some layers were cached I and the images was being built with no problems at all. 一切都工作正常,但看起来像一些层缓存我和图像正在建立没有任何问题。 But since I cleared the cache I can't build the image. 但是因为我清除了缓存,所以无法构建图像。 Here is some of it's content: 以下是其中的一些内容:

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 was working before. 安装了许多其他东西,但正如我所说的一切都在以前工作。 The error is that memcached requires php7 to run. 错误是memcached需要php7才能运行。 I dont know if something has changed in the recent builds of the library but looks like it refuses to work with php5. 我不知道在最近的库版本中是否有变化,但看起来它拒绝使用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

The PECL memcached package introduced the dependency on PHP 7 in version 3.0.0. PECL memcached包在3.0.0版本中引入了对PHP 7的依赖。 You can still install the 2.x version of that package: 您仍然可以安装该软件包的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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM