Let’s start this lab with some cleanup first. Stop all your running containers.

docker ps

Untitled

docker stop container_name
docker rm container_name
###Alternatively, this will delete ALL container
docker container prune

If you need to delete any images that you feel you don’t need, now would be a good time to delete any images as well. (We’ll need the ubuntu/apache2 image and the rastasheep/ubuntu-sshd images for this lab)

docker images
#Comment: List images
docker image rm <image_name>
#Delete anything you don't need

In the previous lab, we created an html file showing a picture within a docker container running an Apache2 web server. This is an example of 1-Tier architecture. The data (information in /var/www/html/) is on the same node as the running Apache2 process. This specific example (hosting web content on Apache2) can be problematic for the following reasons:

In the last lab, we learned to map external ports to internal docker ports for networking. This time, we’ll learn to:

On the host VM (Kali), let’s create a folder to map as a volume

mkdir webpages

Then, let’s create an index.html inside of this webpages folder

cd webpages
pico index.html

Untitled

Verify the full path to your webpages folder

pwd

image.png