Time required: 2 Hours
Using many of the Docker commands we have learned. We will share data from the host to a container.
In this lab, we will put into practice some of the Docker commands that we have learned. Using what we know, we will instantiate a Docker container running apache and use a mounted host directory as the html folder.
We will use a typical client to connect and verify functionality. Then make a change to the contents of the data folder. Changes should be reflected on the instance. Then end the lab by stopping and deleting the container instance.
1. Install Docker and configure the service so that it is running.
2. Pull the Apache Docker container from Docker Hub.
3. Create a host data folder for an index.html file.
4. Create index.html file in the local data folder.
5. Instantiate the Apache instance and mount a data volume to the container.
6. Install a webclient on the host and test the apache instance.
7. Change the data on the data volume and ensure the changes are reflected on the apache instance.
8. Check the container logs.
9. Stop the container instance and verify it has stopped.
10. Delete the datavolume.
11. Delete the Apache container completely from the host system.
12. List all stopped containers to verify it has been removed.