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:

  • docker-compose with mysql init script
  • How to run a new Jupyter Notebook file that's not part of a pre-built docker image in docker?
  • Kubernetes and Dockerfile
  • How to run NodeJS command-line tools inside Docker?
  • PHP & Docker: script unable to write to /tmp
  • Vagrant and NGINX only works on ports other than 80
  • 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?

  • docker-compose not working
  • Ultraedit docker syntax hightlighting file
  • Clone and run laravel application easily
  • docker-compose get ID of a docker
  • What shall I give the ip adress of redis container to which tomcat will connect through source code Docker volume
  • How to run GUI application from linux container in Window using Docker?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.