How to install php-redis extension using the official PHP Docker image approach?

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. The docs say that I can install extensions this way,