Docker - simple Drupal 8 and mysql installation without docker-compose

If you want to have simple and quick drupal 8 with just mysql installation with docker and not running docker compose you need to build 2 containers. One for mysql and other for drupal. First build mysql as we are going to link that to drupal one.

docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_DATABASE=drupal -e MYSQL_USER=drupal -e MYSQL_PASSWORD=drupal -d mysql:5.7

will give you container with set root password, database and user with full privileges for that DB, also we specify mysql version otherwise you would get latest version which maybe wont be compatible with current drupal version (at this point drupal is not compatible out of the box with 8.0).

After that create drupal container

 docker run --name some-drupal -p 8080:80 --link some-mysql:mysql -d drupal

which you can now access on http://localhost:8080/ url and install drupal there.
One not is that for drupal mysql installation you need to go to advanced options and under HOST put name of your container which is "mysql" here.