-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_emane151.ubuntu
142 lines (127 loc) · 4.6 KB
/
Dockerfile_emane151.ubuntu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# syntax=docker/dockerfile:1
FROM ubuntu:22.04
LABEL Description="CORE Docker Ubuntu Image"
ARG PREFIX=/usr/local
ARG CORE_TAG=release-9.0.3
ARG EMANE_TAG=v1.5.1
ARG PROTOC_VERSION=3.19.6
ARG GPSD_VERSION=3.25
ARG OLSRD_BRANCH=master
ARG VENV_PATH=/opt/core/venv
ARG PIP_URL=https://pypi.tuna.tsinghua.edu.cn/simple
ARG CORE_URL_GITEE=https://gitee.com/LongGieGie/core.git
ARG CORE_URL_GITHUB=https://github.com/coreemu/core.git
ARG CORE_URL=${CORE_URL_GITEE}
ARG PROTOC_URL_GITEE=https://gitee.com/LongGieGie/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip
ARG PROTOC_URL_GITHUB=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip
ARG PROTOC_URL=${PROTOC_URL_GITEE}
ARG EMANE_URL_GITEE=https://gitee.com/LongGieGie/emane.git
ARG EMANE_URL_GITHUB=https://github.com/adjacentlink/emane.git
ARG EMANE_URL=${EMANE_URL_GITEE}
ARG OSPF_URL_GITEE=https://gitee.com/LongGieGie/ospf-mdr.git
ARG OSPF_URL_GITHUB=https://github.com/USNavalResearchLaboratory/ospf-mdr.git
ARG OSPF_URL=${OSPF_URL_GITEE}
ARG MGEN_URL_GITHUB=https://github.com/USNavalResearchLaboratory/mgen.git
ARG MGEN_URL_GITEE=https://gitee.com/LongGieGie/mgen.git
ARG MGEN_URL=${MGEN_URL_GITEE}
ARG TRPR_URL_GITHUB=https://github.com/USNavalResearchLaboratory/trpr.git
ARG TRPR_URL_GITEE=https://gitee.com/LongGieGie/trpr.git
ARG TRPR_URL=${TRPR_URL_GITEE}
ARG GPSD_URL=http://download-mirror.savannah.gnu.org/releases/gpsd/gpsd-${GPSD_VERSION}.tar.gz
ARG OLSRD_URL_GITHUB=https://github.com/OLSR/olsrd.git
ARG OLSRD_URL_GITEE=https://gitee.com/LongGieGie/olsrd.git
ARG OLSRD_URL=${OLSRD_URL_GITEE}
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH="$PATH:${VENV_PATH}/bin"
WORKDIR /opt
# install ca-certificates
RUN apt update -y && \
apt install -y --no-install-recommends ca-certificates
# use tsinghua apt source
RUN echo "\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse \n\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse \n\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse \n\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse \n\
" > /etc/apt/sources.list
# install core dependencies
RUN apt update -y && \
apt install -y --no-install-recommends \
ca-certificates \
git \
sudo \
wget \
tzdata \
libpcap-dev \
libpcre3-dev \
libprotobuf-dev \
libxml2-dev \
protobuf-compiler \
unzip \
uuid-dev \
iproute2 \
ethtool \
iputils-ping \
tcpdump \
python3-pip
RUN pip config set global.index-url ${PIP_URL}
# install emane dependencies
RUN apt install -y --no-install-recommends \
gcc g++ autoconf automake libtool \
libxml2-dev libprotobuf-dev libpcap-dev \
libpcre3-dev uuid-dev debhelper pkg-config \
protobuf-compiler git \
dh-python python3-protobuf python3-setuptools
# install extra utils
RUN apt install -y --no-install-recommends \
bridge-utils net-tools iperf3
# install ospf-mdr
RUN cd /opt && \
git clone ${OSPF_URL} && \
cd /opt/ospf-mdr && \
./bootstrap.sh && \
./configure --disable-doc --enable-user=root --enable-group=root \
--with-cflags=-ggdb --sysconfdir=/usr/local/etc/quagga --enable-vtysh \
--localstatedir=/var/run/quagga && \
make -j$(nproc) && \
make install
# install emane
RUN cd /opt && \
git clone ${EMANE_URL} && \
cd /opt/emane && \
git checkout ${EMANE_TAG} && \
./autogen.sh && \
./configure --prefix=/usr && \
make -j$(nproc) && \
make install
# install mgen and trpr
RUN cd /opt && \
git clone ${MGEN_URL} && \
cd mgen && \
git submodule update --init && \
cd makefiles && \
make -f Makefile.linux && \
sudo ln -s /opt/mgen/makefiles/mgen /usr/local/bin/ && \
cd /opt && \
git clone ${TRPR_URL} && \
cd trpr && \
make -f Makefile.linux && \
sudo ln -s /opt/trpr/trpr /usr/local/bin/
# install gpsd and olsrd
RUN apt install -y --no-install-recommends \
gcc scons python3-gi python3-gi-cairo g++ \
libncurses5-dev libtinfo-dev pps-tools \
gir1.2-gtk-3.0 curl bison flex
RUN cd /opt && \
wget ${GPSD_URL} && \
tar -xzf gpsd-${GPSD_VERSION}.tar.gz && \
cd /opt/gpsd-${GPSD_VERSION} && \
scons -c && scons && scons check && scons install
RUN cd /opt && \
git clone ${OLSRD_URL} && \
cd /opt/olsrd && \
git checkout ${OLSRD_BRANCH} && \
make build_all -j$(nproc) && \
make install_all
COPY ./routing.conf /etc/olsrd/routing.conf
WORKDIR /root