-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use dockerfile to install ns3 and ns3-ai autoly #52
Open
pikasTech
wants to merge
1
commit into
hust-diangroup:master
Choose a base branch
from
pikasTech:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+110
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
FROM ubuntu:latest | ||
|
||
ADD sources.list /etc/apt/ | ||
|
||
RUN apt-get update | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata | ||
|
||
# General dependencies | ||
RUN apt-get install -y \ | ||
git \ | ||
mercurial | ||
RUN apt-get install -y \ | ||
wget \ | ||
vim \ | ||
autoconf \ | ||
bzr \ | ||
cvs | ||
RUN apt-get install -y \ | ||
unrar \ | ||
build-essential \ | ||
clang \ | ||
valgrind \ | ||
gsl-bin | ||
RUN apt-get install -y \ | ||
libgslcblas0 \ | ||
libgsl-dev \ | ||
flex \ | ||
bison \ | ||
libfl-dev \ | ||
tcpdump \ | ||
sqlite | ||
RUN apt-get install -y \ | ||
sqlite3 \ | ||
libsqlite3-dev \ | ||
libxml2 \ | ||
libxml2-dev \ | ||
vtun \ | ||
lxc | ||
|
||
# QT4 components | ||
RUN apt-get install -y \ | ||
qtbase5-dev | ||
|
||
# Python components | ||
RUN apt-get install -y \ | ||
python \ | ||
python-dev \ | ||
python-setuptools \ | ||
cmake \ | ||
libc6-dev \ | ||
libc6-dev-i386 \ | ||
g++-multilib | ||
|
||
# NS-3 | ||
|
||
# Create working directory | ||
RUN mkdir -p /usr/ns3 | ||
WORKDIR /usr | ||
|
||
# Fetch NS-3 source | ||
RUN wget http://www.nsnam.org/release/ns-allinone-3.30.tar.bz2 | ||
RUN tar -xf ns-allinone-3.30.tar.bz2 | ||
|
||
# Configure and compile NS-3 | ||
RUN cd ns-allinone-3.30&& ./build.py --enable-examples --enable-tests | ||
|
||
RUN ln -s /usr/ns-allinone-3.30/ns-3.30/ /usr/ns3/ | ||
|
||
# Cleanup | ||
RUN apt-get clean && \ | ||
rm -rf /var/lib/apt && \ | ||
rm /usr/ns-allinone-3.30.tar.bz2 | ||
|
||
RUN apt update | ||
RUN apt install unzip | ||
|
||
RUN cd /usr/ns-allinone-3.30/ns-3.30/contrib && git clone https://gitee.com/lyon1998/ns3-ai | ||
RUN apt install python3 python3-pip -y | ||
RUN cd /usr/ns-allinone-3.30/ns-3.30 && ./waf configure && ./waf | ||
RUN cd /usr/ns-allinone-3.30/ns-3.30/contrib/ns3-ai/py_interface && pip3 install . --user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
docker rmi -f ns3-3.30 | ||
docker build -t ns3-3.30 . | ||
|
||
docker stop ns3-3.30 | ||
docker rm ns3-3.30 | ||
|
||
docker run -it --name ns3-3.30 --restart=always ns3-3.30 bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using ns-allinone-3.30 version, can we try to use git to support different versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can use "RUN git clone ns3" instead of "wget ns3.tar"
but I don't find the repo of ns3, I'm an ns3 beginner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NS3 repository is hosted on gitlab: https://gitlab.com/nsnam/ns-3-dev.