At this point, you should know how to:

Just like we can use *docker rm* to delete containers we don’t want anymore, we can use *docker image rm* to delete an image from disk.

docker images
docker image rm <image_name>
#This will delete an image from disk

In the last two labs, we downloaded an Apache2 docker image running a web server. This web server is in the default configuration, so it listens on port 80. Let’s spin it up and test whether we can reach the default webpage.

docker run -d --name temp_container ubuntu/apache2

Untitled

Now, from your host machine (Windows), we’ll go to the IP address of the VM on which the docker image is running. First, identify the IP Address of the Kali machine running our docker containers.

Untitled

Go to the IP address of the Docker Host (look above) on your Windows machine.

Untitled

Here’s the problem. The Docker image is listening on the interface docker0 (pictured above). This interface is only directly accessible from the docker container host (Kali).

Whenever we create a docker image and want to expose a port on the container to the outside world, we’ll have to use the *-p* flag. We can only do this when we first run the container. This means we must delete the current container and create a new one. (Easy!)