Q:

Install PHP 7 extensions in docker container

I've created a docker container using https://hub.docker.com/_/php/. 
I need to connect from this container to another container running postgres (https://hub.docker.com/_/postgres/). However, I can't seem to get the PHP 7 PDO drivers for postgres to install properly.
Here's what my Dockerfile looks like:
FROM php:7.0-cli
COPY ./app /app
WORKDIR /app
RUN apt-get update && apt-get install -y \
    postgresql-client  \
    && docker-php-ext-install -j$(nproc) pgsql
CMD [ "php", "./do_stuff.php" ]

in place of pgsql I've tried pdo-pgsql, php7.0-pgsql, and tried adding a line to add the ppa:ondrej/php repo to pull from with no luck.
Most of the packages fail to install (even pdo-pgsql which was suggested by docker after failing to find php7.0-pgsql), but the odd one that does install still throws an error that the drivers aren't found when trying to create a PDO connection.
Is there a right way to get the PDO drivers for postgres installed in a docker container?

A:

Ensure the extension is symlinked in /etc/php/7/cli/conf.d or /etc/php/7/fpm/conf.d - folders depend on your distribution.
You can find out if the module is loaded by running
php -m
php7-fpm -m

if the module is missing, check /etc/php/7/modules if the .ini file is present there and symlink it, then the module should get loaded.

