Time required: 2 Hours
We will create a Docker image using a base image and use several commands to create a new image. We will then instantiate an instance from the image, log in to that instance, and ensure that the values we create in the Dockerfile are reflected in the running instance.
In this lab, we will put into practice some of the Dockerfile commands that we have learned. Using what we know, we will create a Dockerfile that uses a base Nginx image from hub.docker.com. We will use the ENV, COPY, ADD commands.
We will then build out the image and run it. We will then log in to the running Docker instance and check that it does what is required. We will also use a web client on the host to ensure it works.
1. Install Docker and configure the service so that it is running.
2. Create an index.html file.
3. Create a Dockerfile. Use Nginx as the base image.
4. Add several directives to the Dockerfile.
5. Build the Dockerfile.
6. Run the Dockerfile.
7. Log int o the instantiated image.
8. Check several parameters exist in the running instance.
9. Stop the container instance and verify it has stopped.
10. Delete the Apache container completely from the host system.
11. List all stopped containers to verify it has been removed.