mysql_install_db in Docker container returns error

I created Dockerfile with follow content:

FROM ubuntu:latest

RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y nano curl apache2 mysql-server-5.6 php5-mysql php5 libapache2-mod-php5 php5-mcrypt php5-intl php5-gd php5-imagick php5-curl 

EXPOSE 80

I build it and run container. When I try to run mysql_install_db in container, I get error:

  • Editing Docker container FS using Atom/Sublime-Text?
  • Custom Production Meteor App /w Docker - Build Fails on Dependecies
  • What's not possible to do in a Docker container?
  • Docker0 interface in CoreOS and Digital Ocean
  • How to connect nsqd and nsqlookupd containers?
  • Docker best practices for security [closed]
  • FATAL ERROR: Could not find my-default.cnf
    

    When I run mysql by command service mysql start, I get message:

    * Starting MySQL database server mysqld. No directory, logging in with HOME=/ [OK]                                                                                                                                                                       
    * Checking for tables which need an upgrade, are corrupt or were not closed cleanly.
    

    If I use MySQL 5.5, it works fine without any errors, as usual.

    What do I do wrong?

  • Service 'odoo' failed to build from docker
  • Need example for sharing data between docker container and docker host
  • Mesos cannot deploy container from private Docker registry
  • Can't see django site being run in docker container on localhost
  • How to quickly switch Docker containers on production?
  • Why am I getting an ErrImagePull error in this Kubernetes deployment?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.