trying to install gmp on docker / php:5.3

I’m trying to test some PHP code on PHP 5.3 with the GMP extension installed. Here’s my Dockerfile:

FROM php:5.3

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 AA8E81B4331F7F50 9D6D8F6BC857C906 
    && apt-get update 
    && apt-get -y install libgmp-dev  
    && docker-php-ext-install gmp

When I try to build that I get an error about how docker-php-ext-install doesn’t exist.

Here’s my second attempt:

FROM php:5.3

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 AA8E81B4331F7F50 9D6D8F6BC857C906 
    && apt-get update 
    && apt-get -y install php5-gmp

That builds without issue but apparently that doesn’t actually result in PHP having the GMP extension. I thought maybe I’d need to add extension=gmp.so to the php.ini file but it’s not immediately clear to me where that file lives. php -i | grep ini returns, among other things, this:

Configuration File (php.ini) Path => /usr/local/lib

But there’s no php.ini file in that directory. I tried to create one but still no luck.

Per chance there’s a PHP 5.3 image floating around that already has the GMP extension installed?

Source: StackOverflow