This repository provides a small docker compose.yml file to easily run NS2 TCL simulations using the ekiourk/ns2:latest docker image.
- You have Docker Desktop installed.
- You have a running X Window Server (such as XQuartz) running on your host, and it is configured to accept connections from localhost.
-
Clone this repository to your local system.
-
Move into this directory.
-
Place your
.tclprograms inside theprogramsfolder. This folder will bebind-mounted into the docker container for ns2 as the/ns2/programsfolder. -
Run
docker compose run --rm ns2The
--rmis important. Without it, docker will create a new container each time you run the command and ultimately take up way too much hard-drive space.You will be dropped into a root
bashshell where the current working directory is/ns2/programs. You should be able to see all the programs that you placed in theprogramsfolder on the host machine here.In the root shell you were dropped into you can run the
ns,namandxgraphcommands (and essentially any command provided by thens-allinone-2.35software).Run a command that invokes a GUI application (like
xgraphon a.xgrfile ornamon a.namfile) and you should see the appropriate window pop up on your desktop. -
Once you're done with
NS2(say, at the end of your semester) you can delete any container created for NS2 (if you ever left out the--rmin thedocker compose runcommand) and theekiourk/ns2 Docker Imagethrough the Docker Desktop dashboard.
Is welcome. Issues and bug reports, as well as pull requests are highly encouraged.
