Build ns-3 on Docker Ubuntu image on Windows 10/11
Build ns-3 open source network simulation software in a convenient Docker image
You need to have Docker installed and be comfortable with Docker on the command line.
At the time of writing this tutorial I was using Ubuntu 18.04 to build ns-3, however, I have had to update my Dockerfile so that it uses ubuntu:latest, which is now 20 something. With apt-get install and such things I think with super old versions of Ubuntu the packages can stop working and such things, so please keep in mind that I cannot possibly maintain every tutorial I write, and some of the calls in the Dockerfile to apt-get install may have new or updated package names or versions by the time you find this tutorial.
See an example project on my Github
GitHub - sitting-duck/simple-ns3-lte
You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or…
Open Powershell and create a folder called ns3-docker
cd into that folder and create a file named Dockerfile
New-Item -Name Dockerfile -ItemType File
Put this into your Dockerfile
RUN echo hello world!
Look at the FROM statement, here, instead of creating our own base image, we’ll use the official Node.js image that already has all the tools and packages that we need. In this case the “12-alpine” image from Node
Dockerfile is called
Dockerfile and located in the root of the “context”. The context is a folder with all the files we will need to build the Docker image. I am passing in . as the context dir. There is only one file in this folder right now and that is the Dockerfile.
$ docker build .
Here is my output:
PS C:\Users\ashle\Documents\GitHub\ns3-docker> docker build .
[+] Building 1.7s (10/10) FINISHED