APCu with Docker and PHP-FPM

Warning

This page is very old and may no longer be relevant. Use with care.

i.e in php:7-fpm or php:7-fpm-alpine

In your Dockerfile:

RUN apk add --update --no-cache --virtual .build-dependencies $PHPIZE_DEPS \
        && pecl install apcu \
        && docker-php-ext-enable apcu \
        && pecl clear-cache \
        && apk del .build-dependencies