There is a section called How to install more PHP extensions that’s how you install more php libraries.
Dockerfile
FROM php:5.6.32-apache-jessie
# Install the necessary packages for Ubuntu
RUN apt-get update && apt-get install -y \
build-essential \
# Install MySQLi extension, this is where you can install the whole list of packages that you want
RUN docker-php-ext-install mysqli pdo pdo_mysql
EXPOSE 80 443
To use mysql, I recommend using a docker-compose.yml file and then link the mysql container to your php container. Here is an example of a docker-compose.yml file:
Then running docker-compose up will start the containers with the things you want. Let me know if you have any questions. I may have missed some stuff.