title: Docker - pdo_mysql (nginx + PHP7 + MariaDB + phpMyAdmin) Symfony + Doctrine
body: <p>I have a little bit problem with install pdo_mysql into my docker container.</p>
  
  <p>In Symfony I got this error:</p>
  
  <blockquote>
    <p>PDOException  PDOException  DriverException
    HTTP 500 Internal Server Error
    An exception occurred in driver: could not find driver</p>
  </blockquote>
  
  <p><strong>Symfony - config.yml</strong></p>
  
  <pre><code>doctrine:
  dbal:
      driver: pdo_mysql
  </code></pre>
  
  <p><strong>Dockerfile</strong></p>
  
  <pre><code>FROM phpdockerio/php7-fpm:latest
  
  # Install selected extensions and other stuff
  RUN apt-get update \
  &amp;&amp; apt-get -y --no-install-recommends install vim mc apt-utils \
  &amp;&amp; php7-pdo_mysql php7-pdo \
  &amp;&amp; apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 
  /usr/share/doc/*
  
  WORKDIR "/var/www/project"
  </code></pre>
  
  <p><strong>docker-compose.yml</strong></p>
  
  <pre><code>version: "3.1"
  services:
  
  mysql:
    image: mariadb
    container_name: project-mariadb
    environment:
      MYSQL_ROOT_PASSWORD: root
  
  
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: project-pma
    restart: always
    links:
      - mysql
    ports:
      - 8183:80
    environment:
      PMA_HOST: mysql
      PMA_USER: root
      PMA_PASSWORD: root
  
  webserver:
    image: nginx:alpine
    container_name: project-websrv
    working_dir: /var/www/project
    volumes:
        - ../../Sources/project/trunk/src/:/var/www/project
        - ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
    ports:
     - "8080:80"
    links:
     - php-fpm
  
  php-fpm:
    build: phpdocker/php-fpm
    container_name: project-php
    working_dir: /var/www/project
    volumes:
      - ../../Sources/project/trunk/src/:/var/www/project
      - ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.0/fpm/conf.d/99-
  overrides.ini
    links:
      - mysql  
  </code></pre>
  
  <p><strong>docker-compose ps</strong></p>
  
  <pre><code>d:\Work\DockerContainers\project&gt;docker-compose ps
   Name                  Command             State          Ports
  ---------------------------------------------------------------------------
  project -mariadb   docker-entrypoint.sh mysqld   Up      3306/tcp
  project -php       /bin/sh -c /usr/bin/php-fpm   Up      9000/tcp
  project -pma       /run.sh phpmyadmin            Up      0.0.0.0:8183-&gt;80/tcp
  project -websrv    nginx -g daemon off;          Up      0.0.0.0:8080-&gt;80/tcp
  
  d:\Work\DockerContainers\project&gt;
  </code></pre>
  
  <p>I have this linux version:</p>
  
  <pre><code>PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
  NAME="Debian GNU/Linux"
  VERSION_ID="8"
  VERSION="8 (jessie)"
  ID=debian
  </code></pre>
  
  <p>I tried to change the package names for pdo_mysql in Dockerfile what I found on the forums, I tried installing through apt-get install directly in the container, but nothing helped I always get the same message:</p>
  
  <pre><code>/bin/sh: 1: docker-php-ext-install: not found (docker-compose build)
  E: Unable to locate package php7-mysql (pdo_mysql etc.) (root in docker container)
  </code></pre>
  
  <p><strong>php-ini-overrides.ini</strong></p>
  
  <pre><code>upload_max_filesize = 100M
  post_max_size = 108M
  extension=pdo.so
  extension=pdo_mysql.so
  </code></pre>
  
  <p>I don´t know if is this problem in Symfony configuration or problem with docker</p>
  
  <p>Can you help me, please?</p>
  
  <p>Thanks a lot</p>