In short, Docker is an open source tool that allows the use of containers. Containers consist of predefined lines of code built by the community. Anyone can push his docker file for other people to use. Of course, Docker has a lot more functionality that I just mentioned: mounting volumes, linking containers and so on. In this blog, I will document my little experience on setting up a full Drupal Development Environment!
As usual, Google search engine was my hero. I came up with many tutorials which helped me to get started with Docker.
Step 0: Install DockerAt first, this step was confusing... docker commands were known for its long commands. Mainly due to flags. But hopefully, I only had to follow the steps command by command!
Step 1: Set up Drupal Development Environment1.1. To start with, a database was needed for local development. In this command, I run a database from the MariaDB image, put 'drupal' as database password and named the container 'drupaldock'
docker run --name drupaldock -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=drupal -d mariadb
1.2. Here we are basically creating and running the Drupal development environment from the insready/drupal-dev image and simultaneously linking the previously created database to it. I named the container 'd8docker' and assigned it the port 8080.
docker run --name d8docker --link drupaldevdb:mysql -p 8080:80 -d drupal
1.3. Now Drupal installation can start. I proceeded by surfing to localhost:8080.
Database type: MySQL, MariaDB, Percona Server or equivalent
Database name: drupal
Database username: root
Database password: password
Port number: 3306