0
0

More than 1 year has passed since last update.

DockerでUbuntu20.04を構築してns-3.32をインストールするまで

Posted at

Dockerイメージの取得

pullコマンドを使って、Ubuntuイメージをダウンロードします。

docker pull ubuntu:20.04
docker image

上記のコマンドでイメージ一覧を確認できるので、20.04があることを確認します。

コンテナに入る

コンテナを起動させるには次のコマンドを入力します。

docker run -it -d --name my-ubuntu ubuntu:20.04

docker psを使うことで起動中のコンテナが確認できるので、コンテナが起動できているか確かめます。
起動したコンテナに入るには次のコマンドを実行します。

docker exec -it my-ubuntu /bin/bash

ns-3.32のインストール

apt update
apt install build-essential autoconf automake libxmu-dev python3-pygraphviz cvs mercurial bzr git cmake p7zip-full python3-matplotlib python-tk python3-dev qt5-qmake qt5-default gnuplot-x11 wireshark
cd home
wget https://www.nsnam.org/releases/ns-allinone-3.32.tar.bz2
tar jxvf ns-allinone-3.32.tar.bz2

ns-3のビルド

cd ns-allinone-3.32/
./build.py --enable-examples --enable-tests

自分の環境では10分程度で終わりました。

サンプルの実行

cd ns-3.32/
./waf --run hello-simulator

hello-simulatorと表示されれば、インストールは成功です。

コンテナから出る

コンテナから抜けるときには、

exit

コンテナを停止するときは、

docker stop my-ubuntu
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0