Docker for Networks

Dockerfile

FROM debian:latest
RUN apt-get update && apt-get install -y \
iputils-ping traceroute dnsutils curl iperf3 nmap \
&& apt-get clean
CMD ["/bin/bash"]

Build the Docker Image

docker build -t net-toolbox .

Verify the Image Was Built

docker images

Run the Container

docker run --rm -it --network=host --name=net_toolbox net-toolbox

Now, you can run networking tools inside the container:

Remove a Specific Image

To remove an image by its name or ID:

docker rmi net-toolbox

https://chatgpt.com/share/67be3604-973c-8012-b7b3-6c12b18b5858