title: docker "mysqld: can't read dir of '/etc/mysql/mysql.conf.d' (os errno 2 - no such file or directory)"
body: <p>I have installed docker-engine and docker-compose on my Ubuntu 16.04 machine.</p>
  
  <p>When installing docker-engine, I followed: <a href="https://www.0x90.it/come-installare-e-usare-docker-su-ubuntu-16-04/" rel="nofollow noreferrer">https://www.0x90.it/come-installare-e-usare-docker-su-ubuntu-16-04/</a></p>
  
  <p>When running the command "docker-compose -f docker-compose-dev.yml up -d", the problem is that service "erentpay_db_1" runs and immediately stops. Here is the content of docker-compose-dev.yml file</p>
  
  <p><strong>docker-compose-dev.yml</strong></p>
  
  <pre><code>version: '2'
  
  services:
      db:
          build: ./docker/mysql
          volumes:
              - ./docker/mysql/data:/var/lib/mysql
              - ./log/mysql:/var/log/mysql
          environment:
              - MYSQL_ROOT_HOST
              - MYSQL_ALLOW_EMPTY_PASSWORD
              - MYSQL_DATABASE
              - MYSQL_USER
              - MYSQL_PASSWORD
          ports:
              - '3307:3306'
  
      nginx:
          build: ./docker/nginx
          ports:
            - '80:80'
            - '443:443'
          volumes:
            - ./log/nginx:/var/log/nginx
            - ./:/var/www/
  
      php:
          build:
              context: ./docker/php
              args:
                  - APP_ENV=dev
          volumes:
              - ./:/var/www/
          environment:
              - SYMFONY__DATABASE__HOST=${MYSQL_ROOT_HOST}
              - SYMFONY__DATABASE__PORT=${MYSQL_PORT}
              - SYMFONY__DATABASE__NAME=${MYSQL_DATABASE}
              - SYMFONY__DATABASE__USER=${MYSQL_USER}
              - SYMFONY__DATABASE__PASSWORD=${MYSQL_PASSWORD}
              - SYMFONY__RABBITMQ__HOST=${RABBITMQ_HOST}
              - SYMFONY__RABBITMQ__PORT=${RABBITMQ_PORT}
              - SYMFONY__RABBITMQ__USER=${RABBITMQ_USER}
              - SYMFONY__RABBITMQ__PASSWORD=${RABBITMQ_PASSWORD}
              - SYMFONY__RABBITMQ__VHOST=${RABBITMQ_VHOST}
              - SYMFONY__STRIPE__PUBLIC__KEY=${STRIPE_PUBLIC_KEY}
              - SYMFONY__STRIPE__SECRET__KEY=${STRIPE_SECRET_KEY}
              - SYMFONY__PLAID__CLIENT__ID=${PLAID_CLIENT_ID}
              - SYMFONY__PLAID__PUBLIC__KEY=${PLAID_PUBLIC_KEY}
              - SYMFONY__PLAID__SECRET__KEY=${PLAID_SECRET_KEY}
              - SYMFONY__PLAID__ENV=${PLAID_ENV}
              - SYMFONY__MAILER__HOST=${MAILER_HOST}
              - SYMFONY__MAILER__USER=${MAILER_USER}
              - SYMFONY__MAILER__PASSWORD=${MAILER_PASSWORD}
              - SYMFONY__MAILER__TRANSPORT=${MAILER_TRANSPORT}
              - SYMFONY__MAILER__PORT=${MAILER_PORT}
              - SYMFONY__MAILER__ENCRYPTION=${MAILER_ENCRYPTION}
              - SYMFONY__CONTACT__EMAIL=${CONTACT_EMAIL}
              - SYMFONY__DOCUSIGN__INTEGRATOR__KEY=${DOCUSIGN_INTEGRATOR_KEY}
              - SYMFONY__DOCUSIGN__USERNAME=${DOCUSIGN_USERNAME}
              - SYMFONY__DOCUSIGN__PASSWORD=${DOCUSIGN_PASSWORD}
              - SYMFONY__DOCUSIGN__ENVIRONMENT=${DOCUSIGN_ENVIRONMENT}
              - SYMFONY__DOCUSIGN__ACCOUNT__ID=${DOCUSIGN_ACCOUNT_ID}
              - SYMFONY__GOOGLE__ANALYTICS__ID=${GOOGLE_ANALYTICS_ID}
  
      rabbitmq:
          image: rabbitmq
          environment:
              - HOSTNAME=${RABBITMQ_HOST}
              - RABBITMQ_NODENAME=rabbitmq
              - RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}
              - RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}
              - RABBITMQ_DEFAULT_VHOST=${RABBITMQ_VHOST}
          ports:
              - 15672:15672
              - 5672:5672
  </code></pre>
  
  <p>Here is the files within <em>./docker/mysql</em> folder</p>
  
  <p><strong>./docker/mysql/Dockerfile</strong></p>
  
  <pre><code>FROM mysql:latest
  
  COPY my.cnf /etc/mysql/my.cnf
  
  RUN rm -rf /var/lib/apt/lists/*
  </code></pre>
  
  <p><strong>./docker/mysql/my.cnf</strong></p>
  
  <pre><code># Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
  # the Free Software Foundation; version 2 of the License.
  #
  # This program is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  # GNU General Public License for more details.
  #
  # You should have received a copy of the GNU General Public License
  # along with this program; if not, write to the Free Software
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  [mysqld]
  sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
  !includedir /etc/mysql/conf.d/
  !includedir /etc/mysql/mysql.conf.d/
  </code></pre>
  
  <p>The error returned by "docker logs erentpay_db_1" is</p>
  
  <blockquote>
    <p>ERROR: mysqld failed while attempting to check config command was:
    "mysqld --verbose --help"</p>
    
    <p>mysqld: Can't read dir of '/etc/mysql/mysql.conf.d' (OS errno 2 - No
    such file or directory) mysqld: [ERROR] Fatal error in defaults
    handling. Program aborted!</p>
  </blockquote>
  
  <p>Here is the list of images</p>
  
  <p><strong>docker images -a</strong></p>
  
  <pre><code>REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
  erentpay_db         latest              7f51bcc584bd        3 minutes ago       445MB
  erentpay_php        latest              fd39b51935a7        4 minutes ago       876MB
  erentpay_nginx      latest              df49934ad7e8        17 minutes ago      108MB
  mysql               latest              8d65ec712c69        33 hours ago        445MB
  php                 5.6-fpm             b755db32196e        2 weeks ago         368MB
  rabbitmq            latest              b17bd9d70e8b        5 weeks ago         127MB
  nginx               stable              1b155f07a3fa        5 weeks ago         108MB
  </code></pre>
  
  <p>and the list of containers</p>
  
  <p><strong>docker ps -a</strong></p>
  
  <pre><code>CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                     PORTS                                                                             NAMES
  9f38d5f7066f        rabbitmq            "docker-entrypoint..."   4 minutes ago       Up 4 minutes               4369/tcp, 0.0.0.0:5672-&gt;5672/tcp, 5671/tcp, 25672/tcp, 0.0.0.0:15672-&gt;15672/tcp   erentpay_rabbitmq_1
  d598eea13e0e        erentpay_nginx      "docker-entrypoint..."   4 minutes ago       Up 4 minutes               0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp                                          erentpay_nginx_1
  5103d20d5489        erentpay_db         "docker-entrypoint..."   4 minutes ago       Exited (1) 4 minutes ago                                                                                     erentpay_db_1
  0ae789206b30        erentpay_php        "docker-entrypoint..."   4 minutes ago       Up 4 minutes               9000/tcp                                                                          erentpay_php_1
  </code></pre>
  
  <p>Please, could someone help me? Thanks</p>