Bug #80546 Cannot start mysql from docker-compose up -d
Submitted: 28 Feb 2016 9:14 Modified: 15 Apr 2018 21:43
Reporter: Sebastian Tarach Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.7.11 OS:Debian
Assigned to: CPU Architecture:Any

[28 Feb 2016 9:14] Sebastian Tarach
Description:
After running docker-compose up -d the mysql container just exits.

docker ps -a
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS                     PORTS                           NAMES
abb0e7048cb9        mysql/mysql-server   "/entrypoint.sh mysql"   6 seconds ago       Exited (1) 5 seconds ago                                   dnmp_mysql_1

Log contains ( docker logs -t <container id> )
2016-02-28T09:12:10.794242924Z Initializing database
And only that

On the other hand when started with docker run command container starts normally.

How to repeat:
file docker-compose.yml
mysql:
    image: mysql/mysql-server
    env_file: ./cfg/mysql.env
    volumes:
        - ./data:/var/lib/mysql
        - ./log/mysql.log:/var/log/mysqld.log

file ./cfg/mysql.env
MYSQL_RANDOM_ROOT_PASSWORD=yes
MYSQL_ONETIME_PASSWORD=yes
MYSQL_DATABASE=my_db
MYSQL_USER=my_user
MYSQL_PASSWORD=my_pass

run: docker-compose up -d
[15 Mar 2018 21:43] MySQL Verification Team
Sorry for the delay, the issue still exists with latest release?. Thanks.
[16 Apr 2018 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".