Docker Community Forums

Share and learn in the Docker community.

Docker-php-ext-enable memcached

docker
build

(Killara) #1

When I build my image, I got this error, help me!

......
+ pecl install memcached-3.0.4
No releases available for package "pecl.php.net/memcached"
install failed
The command '/bin/sh -c set -xe 	&& apk add --no-cache --virtual .build-memcached-deps 		libmemcached-dev 		zlib-dev 		&& pecl install memcached-3.0.4     && docker-php-ext-enable memcached         && apk del .build-memcached-deps' returned a non-zero code: 1
// Dockerfile
FROM php:7.2-fpm-alpine3.6

LABEL maintainer="* <*@github.com>"

RUN set -xe \
	&& apk add --no-cache --virtual .build-core-deps \
		freetype-dev \
		libjpeg-turbo-dev \
		libpng-dev \
		bzip2-dev \
		icu-dev \
		openldap-dev \
		libxml2-dev \
        tidyhtml-dev \
        libxslt-dev \
	\
	&& docker-php-ext-configure gd \
        --with-freetype-dir=/usr/include/ \
        --with-jpeg-dir=/usr/include/ \
        --with-png-dir=/usr/include/ \
	&& export NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
	&& docker-php-ext-install -j${NPROC} gd \
	bcmath \
	bz2 \
	calendar \
	pdo \
	pdo_mysql \
	dba \
	exif \
	intl \
	ldap \
	mysqli \
	pcntl \
	shmop \
	soap \
	sockets \
	sysvmsg \
	sysvsem \
	sysvshm \
	tidy \
	wddx \
	xmlrpc \
	xsl \
	zip \
	\
	&& apk del .build-core-deps

RUN set -xe \
	&& apk add --no-cache --virtual .build-memcached-deps \
		libmemcached-dev \
		zlib-dev \
	\
	&& pecl install memcached-3.0.4 \
    && docker-php-ext-enable memcached \
    \
    && apk del .build-memcached-deps

RUN pecl install redis-3.1.4 && docker-php-ext-enable redis