title: Why can't I run pdo_pgsql in my container?
body: <p>I am trying to use AWS RDS postgresql from my php app. I have modified the Dockerfile to contain
  RUN apt-get update &amp;&amp; apt-get install -y libpq-dev &amp;&amp; docker-php-ext-install pdo pdo_pgsql
  But it doesn't seem to run. I think this because when I (finally) ran phpinfo() from the container, I don't see it loaded. I am assuming that when I run docker-compose up, the Dockerfile (that builds php-fpm) is run  "automatically". Is that true? Here is the Dockerfile that doesn't seem to run:</p>
  
  <pre><code>FROM bitnami/php-fpm:7.2 as builder
  RUN install_packages git autoconf build-essential
  WORKDIR /app
  RUN wget https://github.com/xdebug/xdebug/archive/2.6.0.tar.gz &amp;&amp; \
      tar xzf 2.6.0.tar.gz &amp;&amp; \
      cd xdebug-2.6.0 &amp;&amp; \
      phpize &amp;&amp; \
      ./configure --enable-xdebug &amp;&amp; \
      make &amp;&amp; make install
  RUN apt-get update &amp;&amp; apt-get install -y libpq-dev &amp;&amp; docker-php-ext-install pdo pdo_pgsql
  
  FROM bitnami/php-fpm:7.2
  COPY --from=builder /opt/bitnami/php/lib/php/extensions/xdebug.so /opt/bitnami/php/lib/php/extensions/
  RUN echo 'zend_extension="/opt/bitnami/php/lib/php/extensions/xdebug.so"' &gt;&gt; /opt/bitnami/php/etc/php.ini
  
  RUN echo "xdebug.remote_port=9000" &gt;&gt; /opt/bitnami/php/etc/php.ini \
      &amp;&amp; echo "xdebug.remote_enable=1" &gt;&gt; /opt/bitnami/php/etc/php.ini \
      &amp;&amp; echo "xdebug.remote_connect_back=0" &gt;&gt; /opt/bitnami/php/etc/php.ini \
      &amp;&amp; echo "xdebug.remote_host=192.168.122.1" &gt;&gt; /opt/bitnami/php/etc/php.ini \
      &amp;&amp; echo "xdebug.idekey=docker" &gt;&gt; /opt/bitnami/php/etc/php.ini \
      &amp;&amp; echo "xdebug.remote_autostart=1" &gt;&gt; /opt/bitnami/php/etc/php.ini \
      &amp;&amp; echo "xdebug.remote_log=/tmp/xdebug.log" &gt;&gt; /opt/bitnami/php/etc/php.ini \
      &amp;&amp; echo "extension=pgp_pdo_pgsql.so" &gt;&gt; /opt/bitnami/php/etc/php.ini \
      &amp;&amp; echo "extension=pgp_pgsql.so" &gt;&gt; /opt/bitnami/php/etc/php.ini
  </code></pre>
  
  <p>And here is the docker-compose</p>
  
  <pre><code>version: '3'
  
  services:
  
    apache:
      image: bitnami/apache:latest
      restart: unless-stopped
      ports:
        - 80:8080
      volumes:
        - ./apache/app.conf:/vhosts/app.conf:ro
        - ./app:/app
      networks:
        - net
  
    mysql:
      container_name: "mysql"
      restart: unless-stopped
      image: mysql:5.6
      environment:
        - MYSQL_DATABASE
        - MYSQL_PASSWORD
        - MYSQL_ROOT_PASSWORD
        - MYSQL_USER
      volumes:
        - data:/var/lib/mysql
        - ./mysql/mysql.sql:/docker-entrypoint-initdb.d/mysql.sql
      ports:
        - "3306:3306"
      networks:
        - net
  
    phpmyadmin:
      container_name: phpmyadmin
      restart: unless-stopped
      image: phpmyadmin/phpmyadmin
      environment:
        - PMA_HOST=mysql
        - PMA_PORT=3306
      ports:
        - "8081:80"
      networks:
        - net
  
    php-fpm:
      build: ./php
      restart: unless-stopped
      image: bitnami/php-fpm
      volumes:
        - ./app:/app
      environment:
        - XDEBUG_CONFIG="remote_host=192.168.122.1"
      networks:
        - net
  
    jasperreports:
      image: 'bitnami/jasperreports:7'
      restart: unless-stopped
      environment:
        - MARIADB_HOST=mysql
        - MARIADB_PORT_NUMBER=3306
        - JASPERREPORTS_USERNAME=admin
        - JASPERREPORTS_PASSWORD=bitnami
        - JASPERREPORTS_DATABASE_USER=admin
        - JASPERREPORTS_DATABASE_PASSWORD=xxx
        - JASPERREPORTS_DATABASE_NAME=jasper
        - ALLOW_EMPTY_PASSWORD=yes
      ports:
        - '8080:8080'
      volumes:
        - jasperreports_data:/bitnami
      depends_on:
        - mysql
      networks:
        - net
  
  
  volumes:
    data:
      driver: local
    jasperreports_data:
      driver: local
  </code></pre>
  
  <p>If this Dockerfile is not being run automatically, how do I get it to create a new php-fpm container?</p>