- Go ahead and
stop all your running containers
- Run
docker container prune to delete all stopped containers.
docker stop XXXX
docker container prune
Create a folder to work in.
mkdir /home/student/docker_networks_lab
cd /home/student/docker_networks_lab
In this lab, we’ll look at how to use Docker to simulate private networks. At this point in the year, you should be able to perform subnet math to determine the size and scope of network groups.
We’ll start by examining a standard Docker container.
docker run -d --name My_Apache ubuntu/apache2
Let’s exec into this container and pull a bash shell
docker exec -it My_Apache /bin/bash

Try to view the ip address with ifconfig
ifconfig

Lucky for us, this is an Ubuntu-based image, so we can use the apt package manager within the container.
apt update
apt install net-tools
ifconfig

Exit the container shell
exit
