Running Drupal in Docker

I will assume that you have already installed docker. If you haven't installed docker please visit https://www.docker.com/ to download and install docker for your platform.

Running Drupal in Docker

Drupal requires MySql to function. So before deploying docker you need to deploy a docker instance of MySql/MariaDB. To deploy a MySql Instance on Docker issue the following command

docker run --name mysql -e MYSQL_ROOT_PASSWORD=yourpassword -p 3306:3306 -d mysql:latest

This will deploy the MySql Docker instance

Deploy Drupal Container

docker run --name drupal --link MYSQL-NAME:mysql -p 8000:80 -e MYSQL_USER=root -e MYSQL_PASSWORD=yourpassword -d drupal

This will deploy the Drupal container. Match the MySql credentials to the above command. You can visit the container by visiting http://localhost:8000 or http://YOUR_IP_ADDRESS:8000

In Drupal during installation go to advanced options in Database setup and set the host to the container name of mysql, which in the above case is mysql

Explanation of switches

--name=the name of the instance. You can give it any name you want
-d Run in detached mode
-p Map ports of docker container to local ports
-e Set environment Variables

If you already have images of mysql and drupal

Create a Network by issuing the following command

docker network create drupalnet
docker run --name mysql -e MYSQL_ROOT_PASSWORD=password -p 3306:3306 --net=netw -d mysql:latest
docker run --name drupal -p 8000:80 --net=netw -d drupal:latest

This will create a Network and connect the two containers together.

For learning more about Drupal Visit Getting Started with Drupal. For more information on Drupal on Docker visit Drupal in docker hub.

Hope you find it useful

test table

Pos Team Matches Points Rating
1 India 29 3434 118
2 Australia 30 3534 118
3 England 43 4941 115
4 South Africa 21 2182 104
5 New Zealand 23 2291 100
6 Pakistan 25 2304 92
7 Sri Lanka 27 2123 79
8 West Indies 28 2154 77
9 Bangladesh 19 873 46
10 Zimbabwe 7 223 32

Running Drupal in Docker

I will assume that you have already installed docker. If you haven't installed docker please visit https://www.docker.com/ to download a...