Testing a container locally

Everything that runs in a container remains inside it – this is the principle of container isolation. However, with the port translation that we did previously, with the run command, you can test your container on your local machine.

To do this, open a web browser and enter http://localhost:8080 with 8080, which represents the translation port indicated in the command, and here is the result:

We can see the content of our index.html page displayed.

In this section, we looked at the different Docker commands that can be used to build a Docker image, then we instantiated a new container from that image, and finally, we tested it locally.

In the next section, we will see how to publish a Docker image in Docker Hub.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.133.96