title: File in docker-entrypoint-initdb.d never get executed when using docker compose
body: <p>I'm using Docker Toolbox on Windows 10</p>
  
  <p>I can access the php part succesfully via <a href="http://192.168.99.100:8000" rel="noreferrer">http://192.168.99.100:8000</a>, I have been working around with the mariadb part but still having several problems</p>
  
  <p>I have an sql file as <code>/mariadb/initdb/abc.sql</code> so I should be copied into <code>/docker-entrypoint-initdb.d</code>, after the container is created I use <code>docker-compose exec mariadb</code> to access the container, there is the file as <code>/docker-entrypoint-initdb.d/abc.sql</code> but the file never get executed, I also have tested to import the sql file to the container manually, it was succesful so the sql file is valid</p>
  
  <p>I don't quite understand about the data folder mapping, and what to do to get the folder sync with the container, I always get the warning when recreate the container using <code>docker-compose up -d</code></p>
  
  <p><code>WARNING: Service "mariadb" is using volume "/var/lib/mysql" from the previous container. Host mapping "/.../mariadb/data" has no effect. Remove the existing containers (with docker-compose rm mariadb) to use the Recreating db ... done</code></p>
  
  <p><strong>Questions</strong></p>
  
  <ol>
  <li>How to get the sql file in <code>/docker-entrypoint-initdb.d</code> to be executed ?</li>
  <li>What is the right way to map the data folder with the mariadb container ?</li>
  </ol>
  
  <p>Please guide
  Thanks</p>
  
  <p>This is my <code>docker-compose.yml</code></p>
  
  <pre><code>version: "3.2"
  services:
      php:
          image: php:7.1-apache
          container_name: web
          restart: always
          volumes:
              - /.../php:/var/www/html
          ports:
              - "8000:80"
      mariadb:
          image: mariadb:latest
          container_name: db
          restart: always
          environment:
              - MYSQL_ROOT_PASSWORD=12345
          volumes:
              - /.../mariadb/initdb:/docker-entrypoint-initdb.d
              - /.../mariadb/data:/var/lib/mysql
          ports:
              - "3306:3306"
  </code></pre>