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:

  • Artifactory Professional License - NFS
  • Why Django server with Docker is running without database in postgresql?
  • How do i get postgres data to persist using docker-compose
  • Official Filebeat docker running on windows not allowing application to rotate the log
  • Jenkins Docker Container can't access docker.sock
  • Refresh net.core.somaxcomm (or any sysctl property) for docker containers
  • 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?

  • Can you have a docker copy in the same line as docker run
  • cannot start docker daemon
  • Does it make sense to install the runtime on docker?
  • Lite virtualization of processes
  • Use fig and docker-machine to deploy remotely
  • Debug rails app inside docker use Intellij/Rubymine
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.