Installing postgre driver in php7-fpm Docker container

I’ve installed PHP:latest Docker container using the docker-compose command. It installed php-7.1.6-fpm in my Docker. When I tried to install php7-pgsql extension it failed to find that package, instead found pdo and pdo_pgsql packages. That will not satisfy my need. When I search for the available packages in the installed PHP container, I could not find any related pgsql packages for php7, instead, I saw php5-pgsql package, that will not work with php7-fpm.

Finally, I installed php-5.6-fpm container after removing the old one targeting to use php5-pgsql package. But now I disappointed again that I could not find php5-pgsql package in the newly installed container.

  • Concourse cant put docker image to local repo, not a vaild repository/tag
  • Local folders mapped to container volumes are not synced
  • Docker v1.12 can not change hostname by env variable $HOSTNAME
  • Managing a group of docker containers without the sweat
  • My docker container isn't starting on localhost ( on Docker for Windows (Native using Hyper-V)
  • How to make pull public and push requiring login in docker registry v2?
  • I know I’ll be missing some important points. Whether Alpine Linux does not have php-pgsql extension. What are the possible ways to include this extension in my PHP container. I’ve also included Nginx and Postgres in my docker-compose.yml

    I’ve only 3-day theory knowledge in Docker and first-day practical experience.

    Thanks for reading.

  • How to optimize performance for a docker container?
  • Docker workflow for scientific computing
  • ADD command not working Docker
  • Docker Daemon is not working
  • How to pass command line arguments to a docker image
  • What is the available information about the files and folder inside the docker container?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.