Run `docker-php-ext-install` FROM container other than php : <p>I have a problem with Docker (docker-compose). I want to install some PHP extensions using <code>docker-compose.yml</code>, but I am unable to do this, because my .yml has <code>FROM ubuntu</code> and not <code>FROM php</code>. Is there any way I can achieve or access the <code>docker-php-ext-install</code>?</p>

<h3>Dockerfile</h3>

<pre><code>FROM ubuntu:16.04

RUN apt -yqq update
RUN apt -yqq install nginx iputils-ping
RUN docker-php-ext-install pdo pdo_mysql mbstring

WORKDIR /usr/local/src

COPY docker/nginx/dev.conf /etc/nginx/conf.d/dev.conf
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf

CMD ["nginx"]
</code></pre>

<h3>docker-compose.yml</h3>

<pre><code>version: "2"
services:
  mariadb:
    image: mariadb
    environment:
      - MYSQL_ALLOW_EMPTY_PASSWORD=1
      - MYSQL_ROOT_PASSWORD=
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    ports:
      - "8080:80"
    restart: always
    environment:
      - PMA_HOST=mariadb
    links:
      - mariadb
  php:
    image: php:7.1.1-fpm
    ports:
      - "9000:9000"
    volumes:
      - .:/dogopic
    links:
      - mariadb
  nginx:
    build: .
    ports:
      - "8000:80"
    volumes:
      - .:/dogopic
    links:
      - php
</code></pre>

<h3>Console output (fragment)</h3>

<pre><code>Step 5/9 : RUN docker-php-ext-install pdo pdo_mysql mbstring
 ---&gt; Running in 445f8c82883d
/bin/sh: 1: docker-php-ext-install: not found
</code></pre>
