Docker mysql instant exit
<p>I have a problem with Mysql Docker which exits when I run my <code>docker-compose up</code> command.</p>

<p>Here is my <code>docker-compose.yml</code> file :</p>

<pre><code>version: "2"
services:
    web:
        build: ./app
        links:
            - "db-mongo:db-mongo"
            - "db-mysql:db-mysql"
        ports:
            - "443:3000"
        volumes:
            - "./app:/src"
            - "/src/.sass-cache"
            - "/src/node_modules"
            - "/src/lib"

    db-mongo:
        build: ./mongo
        ports:
            - "27017:27017"
        volumes:
            - "./mongo/db:/data"

    db-mysql:
        image: mysql
        ports:
            - "3306:3306"
        volumes:
            - "./mysql/db:/var/lib/mysql"
            - "./mysql/log:/var/log/mysql"
            - "./mysql/conf.d:/etc/mysql/conf.d"
        environment:
            MYSQL_ROOT_PASSWORD: password
            MYSQL_DATABASE: testt
</code></pre>

<p>Folders <code>./mysql/db</code> and <code>./mysql/log</code> are empty.</p>

<p>When I run <code>docker-compose up</code>, here the output :</p>

<pre><code>db-mysql_1  | Initializing database
server_db-mysql_1 exited with code 1
</code></pre>

<p>When I run <code>docker ps -a</code> :
    0a5a7a643f18        mysql                   "docker-entrypoint.sh"   8 minutes ago       Exited (1) 7 minutes ago     server_db-mysql_1</p>

<p>The strange thing is if I run <code>docker run -d --name=new-mysql -p 3306:3306 -v /var/www/server/mysql/db:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password mysql</code> it works...</p>

<p>And here the output of <code>docker logs 97c -f</code>:</p>

<pre><code>Initializing database
Database initialized
MySQL init process in progress...
Warning: Unable to load '/usr/share/zoneinfo/Factory' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/posix/Factory' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/right/Factory' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.


MySQL init process done. Ready for start up.
</code></pre>

<p>Why does my docker-compose can't keep alive my mysql docker ? I must missing something... Help ! Thanks </p>

<p>EDIT : It appears it is my <code>conf.d</code> folder which is making some problems, because when I remove volume <code>- "./mysql/conf.d:/etc/mysql/conf.d"</code>, server_db-mysql keeps alive.</p>

<p>Here is the <code>mysql/conf.d/my.cnf</code> file content :</p>

<pre><code>[mysqld]
general_log_file = /var/log/mysql/mysql.log
general_log = 1
</code></pre>

<p>Why does that file is crashing the mysql ?</p>