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.

  • What are the differences between dockerfile and stackbrew users on docker hub
  • How to send to stdin of a docker-py container?
  • create-react-app + docker = QA and PROD Deploy
  • swarm, kubernetes or mesos for batch processing jobs
  • Dockerfile - Defining an ENV variable with a dynamic value
  • Docker: setup proxy to download images
  • 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 demonize one image of a docker-compose composition?
  • Apparmor on Docker Swarm
  • Monitoring docker container from docker-java API
  • Load balancing of network requests between replicas of services in docker swarm mode
  • Enable to run Docker command error
  • sbt not generating bin directory when staging or publishing docker + other questions
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.