Author: Gautam Gadipudi
Id: gg7148
All docker testing environment is taken from Professor Fryer's repository: MulticastTestingEnvironment.
This will also build any java files in the current directory in the container.
docker build -t javaapptest .
Only needs to be done once.
docker network create --subnet=172.18.0.0/16 nodenet
This will ultimately run the java Main class as an application.
docker run -it -p 8080:8080 --cap-add=NET_ADMIN --net nodenet --ip 172.18.0.21 javaapptest 1
docker run -it -p 8081:8080 --cap-add=NET_ADMIN --net nodenet --ip 172.18.0.22 javaapptest 2
Using the block=ip http query parameter.
curl "http://localhost:8080/?block=172.18.0.22&block=172.18.0.23"
Using the unblock=ip http query parameter.
curl "http://localhost:8080/?unblock=172.18.0.22"