In this tutorial, you will learn to manage multiple containers on Docker platform. Start up 3 container application and clean it all up by removing all the containers in the end. Use docker container ls command to ensure everything is correct before and after cleanup.
Step # 1 - Start mysql container
The above command starts mysql container with the name db and a random password. Use the docker container logs command to find the random password in logs. The -e option is used to pass in environment variable MYSQL_RANDOM_ROOT_PASSWORD as yes.
Step # 2 - Start apache httpd container
This command start the httpd container port forwarded from 80 to host port 8080.
Step # 3 - Start nginx container
This command runs the nginx server container on port 80.
Step # 4 - List all containers
This should display all three mysql, nginx and httpd newly created containers.
Step # 4 Remove all containers
First stop all three containers:
Then remove all three containers:
At this point you have successfully completed the whole tutorial.