This blog is the continuation of the previous blog of build a Containerized Web Application on Azure (Click here to read the previous blog) . In this blog, we will establish a connection between mysql-container and apache-container.
Now watch those containers with this command:
watch 'sudo docker ps -a'
If mysql-container stops then restart it using following command:
sudo docker start mysql-container
Open the mysql-container shell using the following command and check the status of the mySQL service.
sudo docker exec -it mysql-container bash service mysql status
If MySQL service is not running then start it using the following command:
service mysql start
We have installed the network tools in the apache-container. Now install the network tools in the mysql-container.
apt install inetutils-ping net-tools -y
Checking Connection
Check network cards in the mysql-container.
ifconfig
And note down the IPaddress of the mysql-container and exit from this container and move to host machine. In my case, It is 172.17.0.2.
Read More »