I want to build my PHP-FPM image with php-redis extension based on the official PHP Docker image, for example, using this Dockerfile: php:5.6-fpm.
php-redis
The docs
My opinion, the easiest way is:
RUN pecl install redis && docker-php-ext-enable redis
;)