title: Docker PHP with pdo_pgsql install issue
body: <p>I'm very new to Docker and stepped into my first real project with it. We have a php app using Codeigniter and PostgreSQL and it works great. Now I'm trying to dockerize it and I've run into some troubles with the pdo_pgsql driver.</p>
  <p>I found some help online to get the pdo_pgsql driver to install, however it was all out of date solutions for php-5x. What I have seemed to work because I checked the phpinfo page and my php.ini was loaded in correctly and says the pdo_pgsql and pgsql drivers are both installed and active????</p>
  <p><strong>Here is the error:</strong></p>
  <p>Strange thing is when I first hit the page I only get the first error. Then if I refresh the page the second error shows up.</p>
  <p>When I log into the container and <code>cd</code> to the directory where it says the file does not exist, I can clearly see <code>pdo.so</code>,<code>pdo_pgsql.so</code>, and <code>pgsql.so</code>.</p>
  <blockquote>
  <h2>An Error Was Encountered</h2>
  <p>You have specified an invalid database connection group (dockerize) in your config/database.php file.</p>
  <h2>A PHP Error was encountered</h2>
  <p>Severity: Core Warning</p>
  <p>Message: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/pgsql' - /usr/local/lib/php/extensions/no-debug-non-zts-20160303/pgsql: cannot open shared object file: No such file or directory</p>
  <p>Filename: Unknown</p>
  </blockquote>
  <p><strong>Here is the <code>Dockerfile</code>:</strong></p>
  <pre><code># Dockerfile
  FROM php:7.1.12-apache
  
  MAINTAINER Me &lt;me@myself.com&gt;
  
  COPY deploy/config/php.ini /usr/local/etc/php/
  COPY target/myapp.tar.gz /var/www/html
  
  RUN apt-get update
  
  # Install Postgre PDO
  RUN apt-get install -y libpq-dev \
      &amp;&amp; docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
      &amp;&amp; docker-php-ext-install pdo pdo_pgsql pgsql
  
  RUN tar -xzf /var/www/html/myapp.tar.gz \
      &amp;&amp; cd /var/www/html \
      &amp;&amp; rm -f myapp.tar.gz \
      &amp;&amp; OLD_URL='http://localhost:8080' \
      &amp;&amp; NEW_URL='http://dockerhost:8080' \
      &amp;&amp; sed -i -e &quot;s#$OLD_URL#$NEW_URL#&quot; &quot;/var/www/html/application/config/config.php&quot;
  
  EXPOSE 80
  EXPOSE 443
  </code></pre>
  <p><strong>Here is my <code>docker-compose.yml</code>:</strong></p>
  <pre><code>version: &quot;3&quot;
  services:
    app:
      image: me/myapp:v1
      build: .
      ports:
        - &quot;8080:80&quot;
        - &quot;8043:443&quot;
    postgres:
      image: postgres:9.6.6
      ports:
        - &quot;5432:5432&quot;
  </code></pre>
  <p><strong>Here is my Codeigniter <code>database.php</code>:</strong></p>
  <p>This tries to connect to the Postgres in another container supposedly provided by the docker-compose with the above yml. I read a few places that said I simply use <code>postgres</code> as the host for the connection because the <code>docker-compose.yml</code> file has a service named <code>postgres</code>. This sounds kinda fishy to me, does this look right?</p>
  <pre><code>$active_group = &quot;dockerize&quot;;
  $query_builder = TRUE;
  $db['dockerize'] = array(
          'dsn'       =&gt; 'pgsql:host=postgres;port=5432;dbname=mydb;user=postgres;password=postgres',
          'hostname' =&gt; 'postgres',
          'username' =&gt; 'postgres',
          'password' =&gt; 'postgres',
          'database' =&gt; 'mydb',
          'dbdriver' =&gt; 'pdo',
          'dbprefix' =&gt; '',
          'pconnect' =&gt; FALSE,
          'db_debug' =&gt; (ENVIRONMENT !== 'production'),
          'cache_on' =&gt; FALSE,
          'cachedir' =&gt; '',
          'char_set' =&gt; 'utf8',
          'dbcollat' =&gt; 'utf8_general_ci',
          'swap_pre' =&gt; '',
          'encrypt'  =&gt; FALSE,
          'compress' =&gt; FALSE,
          'stricton' =&gt; FALSE,
          'failover' =&gt; array(),
          'save_queries' =&gt; TRUE
  );
  </code></pre>
  <p>fyi: all the above is anonymized and slimmed down for readability</p>