title: MySQL scripts in docker-entrypoint-initdb are not executed
body: <p>I am trying to create multiple databases when a MySQL container starts up.
  According to <a href="https://github.com/docker-library/mysql/pull/18" rel="noreferrer">https://github.com/docker-library/mysql/pull/18</a>, I can mount or copy my scripts in the <code>/docker-entrypoint-initdb.d</code> of the image and they will be executed automatically on start up.</p>
  
  <p>However my scripts are not at all executed. Seems like the <code>docker-entrypoint.sh</code> doesn't see files in the <code>/docker-entrypoint-initdb.d</code> directory.</p>
  
  <p>This is my Dockerfile:</p>
  
  <pre><code>FROM mysql
  ADD script.sql /docker-entrypoint-initdb.d/script.sql
  RUN chmod -R 775 /docker-entrypoint-initdb.d
  
  ENV MYSQL_ROOT_PASSWORD mypass
  </code></pre>
  
  <p>This is my <code>script.sql</code>:</p>
  
  <pre><code>CREATE DATABASE mydb;
  CREATE DATABASE mydb2;
  </code></pre>
  
  <p>I build and run the container:</p>
  
  <pre><code>$ docker build -t mysql .
  $ docker run -v data_volume:/var/lib/mysql --name somedb -d mysql
  </code></pre>
  
  <p>When I access the container in tty I can see that the <code>script.sql</code> is in the <code>/docker-entrypoint-initdb.d</code> but is not executed.</p>
  
  <p>I have seen the <code>docker logs -f somedb</code> output but there is no error.</p>
  
  <p>I have tried with <code>.sh</code> file, I also have tried with Maria-db, the result is the same.</p>
  
  <p>What could be the problem?</p>