Skip to content

Commit ca1e497

Browse files
committed
updated Dockerfiles for rocky/ubuntu, added build Dockerfile to create rpm/deb packages
1 parent 8070eaf commit ca1e497

File tree

3 files changed

+170
-73
lines changed

3 files changed

+170
-73
lines changed

dockerfiles/Dockerfile.build

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# syntax=docker/dockerfile:1
2+
FROM ubuntu:20.04
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
WORKDIR /opt
5+
RUN apt-get update -y && \
6+
apt-get install -y --no-install-recommends \
7+
automake \
8+
pkg-config \
9+
libev-dev \
10+
nftables \
11+
iproute2 \
12+
ethtool \
13+
tk \
14+
bash \
15+
gem \
16+
curl \
17+
rpm \
18+
ruby \
19+
ca-certificates \
20+
build-essential \
21+
git && \
22+
apt-get autoremove -y && \
23+
rm -rf /var/lib/apt/lists/*
24+
25+
# clone and build core
26+
ARG BRANCH=master
27+
ARG PIPX_VERSION=1.7.1
28+
ARG GRPC_VERSION=1.69.0
29+
ARG INVOKE_VERSION=2.2.0
30+
ARG POETRY_VERSION=1.2.1
31+
ENV PATH="/root/.local/bin:${PATH}"
32+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
33+
git clone https://github.com/coreemu/core.git && \
34+
cd core && \
35+
uv self update && \
36+
uv python install 3.10 && \
37+
uv venv venv && \
38+
uv pip install --python ./venv/bin/python pipx==${PIPX_VERSION} grpcio==${GRPC_VERSION} grpcio-tools==${GRPC_VERSION} && \
39+
./venv/bin/python -m pipx ensurepath && \
40+
./venv/bin/python -m pipx install invoke==${INVOKE_VERSION} && \
41+
./venv/bin/python -m pipx install poetry==${POETRY_VERSION} && \
42+
gem install dotenv -v 2.8.1 && \
43+
gem install fpm && \
44+
git checkout ${BRANCH} && \
45+
./bootstrap.sh && \
46+
PYTHON=./venv/bin/python ./configure --prefix=/usr && \
47+
make -j$(nproc) && \
48+
make fpm

dockerfiles/Dockerfile.rocky

+60-55
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,86 @@
11
# syntax=docker/dockerfile:1
2-
FROM rockylinux:8
3-
ENV LANG en_US.UTF-8
2+
FROM rockylinux/rockylinux:8.10 AS ospf-rpm
43
WORKDIR /opt
5-
6-
# install system dependencies
7-
RUN yum update -y && \
8-
yum install -y \
9-
xterm \
10-
wget \
11-
tcpdump \
12-
python39 \
13-
python39-tkinter \
14-
iproute-tc && \
15-
yum autoremove -y && \
16-
yum clean all
17-
18-
# install ospf mdr
19-
RUN yum update -y && \
20-
yum install -y \
4+
RUN dnf update -y && \
5+
dnf install -y epel-release dnf-plugins-core && \
6+
dnf config-manager --set-enabled powertools && \
7+
dnf update -y && \
8+
dnf install -y \
9+
texinfo \
10+
rpm-build \
11+
texlive-base \
12+
texinfo-tex \
13+
texi2html \
14+
readline-devel \
15+
libpcap-devel \
16+
ImageMagick \
17+
git \
2118
automake \
22-
gcc-c++ \
2319
libtool \
24-
make \
2520
pkg-config \
26-
readline-devel \
27-
git && \
21+
gcc-c++ \
22+
libcap-devel \
23+
make && \
2824
git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git && \
2925
cd ospf-mdr && \
3026
./bootstrap.sh && \
31-
./configure --disable-doc --enable-user=root --enable-group=root \
32-
--with-cflags=-ggdb --sysconfdir=/usr/local/etc/quagga --enable-vtysh \
33-
--localstatedir=/var/run/quagga && \
34-
make -j$(nproc) && \
35-
make install && \
27+
./configure && \
28+
(make -f quagga.rpm.mk build || make -f quagga.rpm.mk build) && \
29+
mv .rpmbuild/RPMS/x86_64/quagga-mr-0.99*.rpm /opt/ && \
3630
cd /opt && \
3731
rm -rf ospf-mdr && \
38-
yum remove -y \
39-
automake \
40-
gcc-c++ \
41-
libtool \
42-
make \
43-
pkg-config \
44-
readline-devel \
45-
git && \
46-
yum autoremove -y --skip-broken && \
47-
yum clean all
32+
dnf autoremove -y && \
33+
dnf clean all
4834

35+
FROM rockylinux/rockylinux:8.10
36+
ENV LANG en_US.UTF-8
37+
WORKDIR /opt
38+
# install system dependencies
39+
RUN dnf update -y && \
40+
dnf install -y \
41+
xterm \
42+
wget \
43+
tcpdump \
44+
python3.12 \
45+
python3.12-tkinter \
46+
iproute-tc && \
47+
dnf autoremove -y && \
48+
dnf clean all
49+
# install core
50+
ARG CORE_PACKAGE=core_9.2.0_x86_64.rpm
51+
ARG PACKAGE_URL=https://github.com/coreemu/core/releases/latest/download/${CORE_PACKAGE}
52+
RUN dnf update -y && \
53+
wget -q ${PACKAGE_URL} && \
54+
PYTHON=python3.12 dnf install -y ./${CORE_PACKAGE} && \
55+
rm -f ${CORE_PACKAGE} && \
56+
dnf autoremove -y && \
57+
dnf clean all
58+
# install ospf mdr
59+
COPY --from=ospf-rpm /opt/quagga-mr-0.99*.rpm .
60+
RUN dnf update -y && \
61+
dnf install -y \
62+
./quagga-mr-0.99*.rpm && \
63+
dnf autoremove -y && \
64+
dnf clean all
4965
# install emane
50-
ARG EMANE_VERSION=1.5.1
66+
ARG EMANE_VERSION=1.5.2
5167
ARG EMANE_RELEASE=emane-${EMANE_VERSION}-release-1
5268
ARG EMANE_PACKAGE=${EMANE_RELEASE}.el8.x86_64.tar.gz
53-
RUN yum update -y && \
69+
RUN dnf update -y && \
5470
wget -q https://adjacentlink.com/downloads/emane/${EMANE_PACKAGE} && \
5571
tar xf ${EMANE_PACKAGE} && \
5672
cd ${EMANE_RELEASE}/rpms/el8/x86_64 && \
5773
rm emane-spectrum-tools-*.rpm emane-model-lte*.rpm && \
5874
rm *devel*.rpm && \
59-
yum install -y ./emane*.rpm ./python3-emane-${EMANE_VERSION}-1.el8.noarch.rpm && \
75+
dnf install -y ./emane*.rpm ./python3-emane-${EMANE_VERSION}-1.el8.noarch.rpm && \
6076
cd ../../../.. && \
6177
rm ${EMANE_PACKAGE} && \
6278
rm -rf ${EMANE_RELEASE} && \
63-
yum autoremove -y && \
64-
yum clean all
65-
66-
# install core
67-
ARG CORE_PACKAGE=core_9.1.0_x86_64.rpm
68-
ARG PACKAGE_URL=https://github.com/coreemu/core/releases/latest/download/${CORE_PACKAGE}
69-
RUN yum update -y && \
70-
wget -q ${PACKAGE_URL} && \
71-
PYTHON=python3.9 yum install -y ./${CORE_PACKAGE} && \
72-
rm -f ${CORE_PACKAGE} && \
73-
yum autoremove -y && \
74-
yum clean all
75-
79+
dnf autoremove -y && \
80+
dnf clean all
7681
# install emane python bindings
7782
ARG VENV_PATH=/opt/core/venv
7883
COPY --from=emane-python /opt/emane-*.whl .
79-
RUN ${VENV_PATH}/bin/python -m pip install ./emane-*.whl
80-
84+
RUN ${VENV_PATH}/bin/python -m pip install ./emane-*.whl setuptools
85+
# set default directory
8186
WORKDIR /root

dockerfiles/Dockerfile.ubuntu

+62-18
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
11
# syntax=docker/dockerfile:1
2+
FROM ubuntu:22.04 AS ospf-deb
3+
WORKDIR /opt
4+
RUN apt-get update -y && \
5+
apt-get install -y --no-install-recommends \
6+
git \
7+
ca-certificates \
8+
automake \
9+
make \
10+
libtool \
11+
pkg-config \
12+
gawk \
13+
g++ \
14+
dpkg-dev \
15+
debhelper \
16+
libreadline-dev \
17+
texinfo \
18+
imagemagick \
19+
groff \
20+
build-essential:native \
21+
texlive-latex-recommended \
22+
texlive-plain-generic && \
23+
git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git && \
24+
cd ospf-mdr && \
25+
./bootstrap.sh && \
26+
./configure && \
27+
(make -f quagga.deb.mk build || make -f quagga.deb.mk build) && \
28+
mv quagga-mr_0.99*.deb /opt/ && \
29+
cd /opt && \
30+
rm -rf ospf-mdr && \
31+
apt-get autoremove -y && \
32+
rm -rf /var/lib/apt/lists/*
33+
234
FROM ubuntu:22.04
335
ENV DEBIAN_FRONTEND=noninteractive
436
WORKDIR /opt
5-
637
# install system dependencies
738
RUN apt-get update -y && \
839
apt-get install -y --no-install-recommends \
@@ -11,23 +42,47 @@ RUN apt-get update -y && \
1142
psmisc \
1243
python3 \
1344
python3-tk \
14-
python3-pip \
1545
python3-venv \
46+
python3-pip \
1647
wget \
1748
iproute2 \
1849
iputils-ping \
50+
curl \
1951
tcpdump && \
2052
apt-get autoremove -y && \
2153
rm -rf /var/lib/apt/lists/*
22-
54+
# install core
55+
ARG CORE_PACKAGE=core_9.2.0_amd64.deb
56+
ARG PACKAGE_URL=https://github.com/coreemu/core/releases/latest/download/${CORE_PACKAGE}
57+
RUN apt-get update -y && \
58+
wget -q ${PACKAGE_URL} && \
59+
apt-get install -y --no-install-recommends ./${CORE_PACKAGE} && \
60+
rm -f ${CORE_PACKAGE} && \
61+
apt-get autoremove -y && \
62+
rm -rf /var/lib/apt/lists/*
2363
# install ospf mdr
24-
COPY --from=ospf-deb /opt/quagga-mr_0.99*.deb .
2564
RUN apt-get update -y && \
2665
apt-get install -y --no-install-recommends \
27-
./quagga-mr_0.99*.deb && \
66+
automake \
67+
make \
68+
gawk \
69+
git \
70+
g++ \
71+
libreadline-dev \
72+
libtool \
73+
pkg-config && \
2874
apt-get autoremove -y && \
2975
rm -rf /var/lib/apt/lists/*
30-
76+
RUN git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git && \
77+
cd ospf-mdr && \
78+
./bootstrap.sh && \
79+
./configure --disable-doc --enable-user=root --enable-group=root \
80+
--with-cflags=-ggdb --sysconfdir=/usr/local/etc/quagga --enable-vtysh \
81+
--localstatedir=/var/run/quagga && \
82+
make -j$(nproc) && \
83+
make install && \
84+
cd .. && \
85+
rm -rf ospf-mdr
3186
# install emane
3287
ARG EMANE_RELEASE=emane-1.5.1-release-1
3388
ARG EMANE_PACKAGE=${EMANE_RELEASE}.ubuntu-22_04.amd64.tar.gz
@@ -43,20 +98,9 @@ RUN apt-get update -y && \
4398
rm -rf ${EMANE_RELEASE} && \
4499
apt-get autoremove -y && \
45100
rm -rf /var/lib/apt/lists/*
46-
47-
# install core
48-
ARG CORE_PACKAGE=core_9.1.0_amd64.deb
49-
ARG PACKAGE_URL=https://github.com/coreemu/core/releases/latest/download/${CORE_PACKAGE}
50-
RUN apt-get update -y && \
51-
wget -q ${PACKAGE_URL} && \
52-
apt-get install -y --no-install-recommends ./${CORE_PACKAGE} && \
53-
rm -f ${CORE_PACKAGE} && \
54-
apt-get autoremove -y && \
55-
rm -rf /var/lib/apt/lists/*
56-
57101
# install emane python bindings
58102
ARG VENV_PATH=/opt/core/venv
59103
COPY --from=emane-python /opt/emane-*.whl .
60104
RUN ${VENV_PATH}/bin/python -m pip install ./emane-*.whl
61-
105+
# set default directory
62106
WORKDIR /root

0 commit comments

Comments
 (0)